ObjFW  Check-in [1940d72ec7]

Overview
Comment:Rename -[connetToHost:onPort:] to -[connectToHost:port:].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 1940d72ec7d3af904cc1cfbf498a215ee4cb92bab08061912db8eb73ebd8252e
User & Date: js on 2011-06-05 18:53:27
Other Links: manifest | tags
Context
2011-06-05
19:12
Add import for OFSerialization.h to ObjFW.h. check-in: 0449004f4e user: js tags: trunk
18:53
Rename -[connetToHost:onPort:] to -[connectToHost:port:]. check-in: 1940d72ec7 user: js tags: trunk
18:44
Check size of float and double. check-in: c3f475701c user: js tags: trunk
Changes

Modified src/OFHTTPRequest.m from [bfdcb9668e] to [6cdf31afd0].

214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
		OFString *key, *object, *contentLengthHeader;
		int status;
		const char *type = NULL;
		char *buffer;
		size_t bytesReceived;

		[sock connectToHost: [URL host]
			     onPort: [URL port]];

		/*
		 * Work around a bug with packet bisection in lighttpd when
		 * using HTTPS.
		 */
		[sock setBuffersWrites: YES];








|







214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
		OFString *key, *object, *contentLengthHeader;
		int status;
		const char *type = NULL;
		char *buffer;
		size_t bytesReceived;

		[sock connectToHost: [URL host]
			       port: [URL port]];

		/*
		 * Work around a bug with packet bisection in lighttpd when
		 * using HTTPS.
		 */
		[sock setBuffersWrites: YES];

Modified src/OFTCPSocket.h from [5adaf7382b] to [abc527a77c].

44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/**
 * Connect the OFTCPSocket to the specified destination.
 *
 * \param host The host to connect to
 * \param port The port on the host to connect to
 */
- (void)connectToHost: (OFString*)host
	       onPort: (uint16_t)port;

/**
 * Bind the socket on the specified port and host.
 *
 * \param port The port to bind to. If the port is 0, an unused port will be
 *	       chosen, which can be obtained using the return value.
 * \param host The host to bind to. Use @"0.0.0.0" for IPv4 or @"::" for IPv6







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/**
 * Connect the OFTCPSocket to the specified destination.
 *
 * \param host The host to connect to
 * \param port The port on the host to connect to
 */
- (void)connectToHost: (OFString*)host
		 port: (uint16_t)port;

/**
 * Bind the socket on the specified port and host.
 *
 * \param port The port to bind to. If the port is 0, an unused port will be
 *	       chosen, which can be obtained using the return value.
 * \param host The host to bind to. Use @"0.0.0.0" for IPv4 or @"::" for IPv6

Modified src/OFTCPSocket.m from [9d4c499443] to [d8e9d867f6].

75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
	sock = INVALID_SOCKET;
	sockAddr = NULL;

	return self;
}

- (void)connectToHost: (OFString*)host
	       onPort: (uint16_t)port
{
	if (sock != INVALID_SOCKET)
		@throw [OFAlreadyConnectedException newWithClass: isa
							  socket: self];

#ifdef HAVE_THREADSAFE_GETADDRINFO
	struct addrinfo hints, *res, *res0;







|







75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
	sock = INVALID_SOCKET;
	sockAddr = NULL;

	return self;
}

- (void)connectToHost: (OFString*)host
		 port: (uint16_t)port
{
	if (sock != INVALID_SOCKET)
		@throw [OFAlreadyConnectedException newWithClass: isa
							  socket: self];

#ifdef HAVE_THREADSAFE_GETADDRINFO
	struct addrinfo hints, *res, *res0;

Modified tests/OFTCPSocketTests.m from [5ae827977d] to [2ddc4ec324].

41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57

	TEST(@"-[bindToPort:onHost:]",
	    (port = [server bindToPort: 0
				onHost: @"127.0.0.1"]))

	TEST(@"-[listen]", R([server listen]))

	TEST(@"-[connectToHost:onPort:]",
	    R([client connectToHost: @"127.0.0.1"
			     onPort: port]))

	TEST(@"-[accept]", (accepted = [server accept]))

	TEST(@"-[remoteAddress]",
	    [[accepted remoteAddress] isEqual: @"127.0.0.1"])

	TEST(@"-[writeString:]", [client writeString: @"Hello!"])







|

|







41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57

	TEST(@"-[bindToPort:onHost:]",
	    (port = [server bindToPort: 0
				onHost: @"127.0.0.1"]))

	TEST(@"-[listen]", R([server listen]))

	TEST(@"-[connectToHost:port:]",
	    R([client connectToHost: @"127.0.0.1"
			       port: port]))

	TEST(@"-[accept]", (accepted = [server accept]))

	TEST(@"-[remoteAddress]",
	    [[accepted remoteAddress] isEqual: @"127.0.0.1"])

	TEST(@"-[writeString:]", [client writeString: @"Hello!"])