ObjFW  Check-in [0b8c5616cb]

Overview
Comment:Rename + tcpSocket to + socket in OFTCPSocket.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 0b8c5616cba78ea249b5b1657b7991aefd7b731adeba07a2e6699fd93c152d23
User & Date: js on 2009-05-19 17:13:43
Other Links: manifest | tags
Context
2009-05-20
19:59
Implement OFCopying protocol for OFList. check-in: 5d190947a7 user: js tags: trunk
2009-05-19
17:13
Rename + tcpSocket to + socket in OFTCPSocket. check-in: 0b8c5616cb user: js tags: trunk
16:51
Add - isEqual: for OFList. check-in: 7f7e9715e1 user: js tags: trunk
Changes

Modified src/OFTCPSocket.h from [f1ec44f94b] to [fabcbf213d].

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/**
 * The OFTCPSocket class provides functions to create and use sockets.
 */
@interface OFTCPSocket: OFSocket {}
/**
 * \return A new autoreleased OFTCPSocket
 */
+ tcpSocket;

/**
 * Initializes an already allocated OFTCPSocket.
 *
 * \return An initialized OFTCPSocket
 */
- init;







|







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/**
 * The OFTCPSocket class provides functions to create and use sockets.
 */
@interface OFTCPSocket: OFSocket {}
/**
 * \return A new autoreleased OFTCPSocket
 */
+ socket;

/**
 * Initializes an already allocated OFTCPSocket.
 *
 * \return An initialized OFTCPSocket
 */
- init;

Modified src/OFTCPSocket.m from [da3f38fa70] to [0f5f259ee4].

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#import "OFExceptions.h"

#ifndef INVALID_SOCKET
#define INVALID_SOCKET -1
#endif

@implementation OFTCPSocket
+ tcpSocket
{
	return [[[OFTCPSocket alloc] init] autorelease];
}

- init
{
	self = [super init];







|







19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#import "OFExceptions.h"

#ifndef INVALID_SOCKET
#define INVALID_SOCKET -1
#endif

@implementation OFTCPSocket
+ socket
{
	return [[[OFTCPSocket alloc] init] autorelease];
}

- init
{
	self = [super init];
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
- (OFTCPSocket*)accept
{
	OFTCPSocket *newsock;
	struct sockaddr *addr;
	socklen_t addrlen;
	int s;

	newsock = [OFTCPSocket tcpSocket];
	addrlen = sizeof(struct sockaddr);

	@try {
		addr = [newsock allocWithSize: sizeof(struct sockaddr)];
	} @catch (OFException *e) {
		[newsock dealloc];
		@throw e;







|







153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
- (OFTCPSocket*)accept
{
	OFTCPSocket *newsock;
	struct sockaddr *addr;
	socklen_t addrlen;
	int s;

	newsock = [OFTCPSocket socket];
	addrlen = sizeof(struct sockaddr);

	@try {
		addr = [newsock allocWithSize: sizeof(struct sockaddr)];
	} @catch (OFException *e) {
		[newsock dealloc];
		@throw e;

Modified tests/OFTCPSocket/OFTCPSocket.m from [2d157422ed] to [6730a65c28].

36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{
	uint16_t port;
	OFString *service;

	srand(time(NULL));

	@try {
		OFTCPSocket *server = [OFTCPSocket tcpSocket];
		OFTCPSocket *client = [OFTCPSocket tcpSocket];
		OFTCPSocket *accepted;
		char buf[7];

		puts("== IPv4 ==");
		port = get_port();
		service = [OFString stringWithFormat: @"%d", port];








|
|







36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{
	uint16_t port;
	OFString *service;

	srand(time(NULL));

	@try {
		OFTCPSocket *server = [OFTCPSocket socket];
		OFTCPSocket *client = [OFTCPSocket socket];
		OFTCPSocket *accepted;
		char buf[7];

		puts("== IPv4 ==");
		port = get_port();
		service = [OFString stringWithFormat: @"%d", port];