15{
23 int addrsize;
27 fd_set readfds, writefds, exceptfds;
30
32 {
33 skip(
"ROSTESTS-247: Skipping ws2_32_apitest:nonblocking because it times out on testbot\n");
34 return;
35 }
36
38 {
39 skip(
"WSAStartup failed\n");
40 return;
41 }
42
45
47 {
48 skip(
"ERROR: Server socket creation failed\n");
49 return;
50 }
52 {
53 skip(
"ERROR: Client socket creation failed\n");
55 return;
56 }
57 server_addr_in.sin_family =
AF_INET;
60
61
62 trace(
"Initializing server and client connections ...\n");
64 ok(
err == 0,
"ERROR: server bind failed\n");
66 ok(
err == 0,
"ERROR: server ioctlsocket FIONBIO failed\n");
67
68
70 ok(
err == 0,
"ERROR: client ioctlsocket FIONBIO failed\n");
71
72
73 trace(
"Starting server listening mode ...\n");
75 ok(
err == 0,
"ERROR: cannot initialize server listen\n");
76
77 trace(
"Starting client to server connection ...\n");
78
81 nConRes =
connect(ClientSocket, (
struct sockaddr*)&server_addr_in,
sizeof(server_addr_in));
82 ok(nConRes ==
SOCKET_ERROR,
"ERROR: client connect() result is not SOCKET_ERROR\n");
88
90 {
91 addrsize = sizeof(addr_con_loc);
94 {
95 dwLen = sizeof(addr_con_loc);
99 {
100 trace(
"Event FD_CONNECT...\n");
103 ok(
err == -1,
"ERROR: error reading data from connected socket, error %d\n",
WSAGetLastError());
107 }
108 else
109 {
111 }
112 }
113
114 err =
select(1, &readfds, &writefds, &exceptfds, &tval);
116 {
117 trace(
"Event FD_ACCEPT...\n");
118 addrsize = sizeof(addr_remote);
122 dwLen = sizeof(addr_remote);
126 ok(dwAddrLen > 7,
"len <= 7\n");
128 ok(
err == dwAddrLen,
"ERROR: error sending data on accepted socket, error %d\n",
WSAGetLastError());
129 }
130 }
131
135
137}
INT WSAAPI recv(IN SOCKET s, OUT CHAR FAR *buf, IN INT len, IN INT flags)
INT WSAAPI select(IN INT s, IN OUT LPFD_SET readfds, IN OUT LPFD_SET writefds, IN OUT LPFD_SET exceptfds, IN CONST struct timeval *timeout)
INT WSAAPI send(IN SOCKET s, IN CONST CHAR FAR *buf, IN INT len, IN INT flags)
INT WINAPI WSAStartup(IN WORD wVersionRequested, OUT LPWSADATA lpWSAData)
INT WSAAPI WSAAddressToStringA(IN LPSOCKADDR lpsaAddress, IN DWORD dwAddressLength, IN LPWSAPROTOCOL_INFOA lpProtocolInfo, OUT LPSTR lpszAddressString, IN OUT LPDWORD lpdwAddressStringLength)
INT WSAAPI getsockname(IN SOCKET s, OUT LPSOCKADDR name, IN OUT INT FAR *namelen)
INT WSAAPI listen(IN SOCKET s, IN INT backlog)
INT WSAAPI bind(IN SOCKET s, IN CONST struct sockaddr *name, IN INT namelen)
SOCKET WSAAPI accept(IN SOCKET s, OUT LPSOCKADDR addr, OUT INT FAR *addrlen)
SOCKET WSAAPI socket(IN INT af, IN INT type, IN INT protocol)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
#define FD_ISSET(fd, set)
int PASCAL FAR WSAGetLastError(void)
int PASCAL FAR WSACleanup(void)