| 46 | } |
| 47 | |
| 48 | SOCKET create(JNIEnv* e) |
| 49 | { |
| 50 | SOCKET sock; |
| 51 | if (INVALID_SOCKET == (sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP))) { |
| 52 | char buf[255]; |
| 53 | sprintf( |
| 54 | buf, "Can't create a socket. System error: %d", last_socket_error()); |
| 55 | throwNew(e, "java/io/IOException", buf); |
| 56 | return 0; // This doesn't matter cause we have risen an exception |
| 57 | } |
| 58 | return sock; |
| 59 | } |
| 60 | |
| 61 | void connect(JNIEnv* e, SOCKET sock, long addr, short port) |
| 62 | { |
no test coverage detected