ObjFW  Check-in [f3ca0f6a2c]

Overview
Comment:Treat EWOULDBLOCK equal to EINPROGRESS on Windows
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: f3ca0f6a2c2402247b2cd38f8d478d7303ea75f39c79d66bc864fdccadf9237f
User & Date: js on 2021-05-08 20:07:09
Other Links: manifest | tags
Context
2021-05-08
23:22
tests: Align more with ObjFW style check-in: 14f1e22d79 user: js tags: trunk
20:07
Treat EWOULDBLOCK equal to EINPROGRESS on Windows check-in: f3ca0f6a2c user: js tags: trunk
19:30
Fix setCanBlock: being inverted on Windows/AmigaOS check-in: 91131d6d7d user: js tags: trunk
Changes

Modified src/OFIPSocketAsyncConnector.m from [8b23b2fea4] to [f532e1ec24].

169
170
171
172
173
174
175



176

177
178
179
180
181
182
183
	[_socket setCanBlock: true];
#else
	[_socket setCanBlock: false];
#endif

	if (![_socket of_connectSocketToAddress: &address errNo: &errNo]) {
#if !defined(OF_NINTENDO_3DS) && !defined(OF_WII)



		if (errNo == EINPROGRESS) {

			[OFRunLoop of_addAsyncConnectForSocket: _socket
							  mode: runLoopMode
						      delegate: self];
			return;
		} else {
#endif
			[_socket of_closeSocket];







>
>
>

>







169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
	[_socket setCanBlock: true];
#else
	[_socket setCanBlock: false];
#endif

	if (![_socket of_connectSocketToAddress: &address errNo: &errNo]) {
#if !defined(OF_NINTENDO_3DS) && !defined(OF_WII)
# ifdef OF_WINDOWS
		if (errNo == EINPROGRESS || errNo == EWOULDBLOCK) {
# else
		if (errNo == EINPROGRESS) {
# endif
			[OFRunLoop of_addAsyncConnectForSocket: _socket
							  mode: runLoopMode
						      delegate: self];
			return;
		} else {
#endif
			[_socket of_closeSocket];

Modified src/OFSPXSocket.m from [6a8d63bff0] to [1dcd330269].

113
114
115
116
117
118
119



120

121
122
123
124
125
126
127
		exception = [self of_connectionFailedExceptionForErrNo: errNo];
		goto inform_delegate;
	}

	_socket.canBlock = false;

	if (![_socket of_connectSocketToAddress: &address errNo: &errNo]) {



		if (errNo == EINPROGRESS) {

			[OFRunLoop of_addAsyncConnectForSocket: _socket
							  mode: runLoopMode
						      delegate: self];
			return;
		}

		[_socket of_closeSocket];







>
>
>

>







113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
		exception = [self of_connectionFailedExceptionForErrNo: errNo];
		goto inform_delegate;
	}

	_socket.canBlock = false;

	if (![_socket of_connectSocketToAddress: &address errNo: &errNo]) {
#ifdef OF_WINDOWS
		if (errNo == EINPROGRESS || errNo == EWOULDBLOCK) {
#else
		if (errNo == EINPROGRESS) {
#endif
			[OFRunLoop of_addAsyncConnectForSocket: _socket
							  mode: runLoopMode
						      delegate: self];
			return;
		}

		[_socket of_closeSocket];

Modified src/OFSPXStreamSocket.m from [cf40daf6c1] to [d6a9ec0451].

114
115
116
117
118
119
120



121

122
123
124
125
126
127
128
		exception = [self of_connectionFailedExceptionForErrNo: errNo];
		goto inform_delegate;
	}

	_socket.canBlock = false;

	if (![_socket of_connectSocketToAddress: &address errNo: &errNo]) {



		if (errNo == EINPROGRESS) {

			[OFRunLoop of_addAsyncConnectForSocket: _socket
							  mode: runLoopMode
						      delegate: self];
			return;
		}

		[_socket of_closeSocket];







>
>
>

>







114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
		exception = [self of_connectionFailedExceptionForErrNo: errNo];
		goto inform_delegate;
	}

	_socket.canBlock = false;

	if (![_socket of_connectSocketToAddress: &address errNo: &errNo]) {
#ifdef OF_WINDOWS
		if (errNo == EINPROGRESS || errNo == EWOULDBLOCK) {
#else
		if (errNo == EINPROGRESS) {
#endif
			[OFRunLoop of_addAsyncConnectForSocket: _socket
							  mode: runLoopMode
						      delegate: self];
			return;
		}

		[_socket of_closeSocket];