| 273 | } |
| 274 | |
| 275 | void doFinishConnect(JNIEnv* e, int socket) |
| 276 | { |
| 277 | int error; |
| 278 | socklen_t size = sizeof(int); |
| 279 | int r = getsockopt( |
| 280 | socket, SOL_SOCKET, SO_ERROR, reinterpret_cast<char*>(&error), &size); |
| 281 | |
| 282 | if (r != 0 or size != sizeof(int)) { |
| 283 | throwIOException(e); |
| 284 | } else if (error and not einProgress(error)) { |
| 285 | throwIOException(e, socketErrorString(e, error)); |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | bool doConnect(JNIEnv* e, int s, sockaddr_in* address) |
| 290 | { |
no test coverage detected