version 1.1, 2005/03/10 11:34:15
|
version 1.2, 2005/03/15 22:05:53
|
|
|
| |
// Send the packet back | // Send the packet back |
n_sent = send( socket, file_buf, n_recvd, 0 ); | n_sent = send( socket, file_buf, n_recvd, 0 ); |
wsa_ok( n_sent, SOCKET_ERROR !=, "send (%lx): error %d:\n" ); |
ok( n_sent == n_recvd, |
|
"simple_server (%x): sent less data than expected: %d of %d\n", id, n_sent, n_recvd); |
if( n_sent == SOCKET_ERROR ){ | if( n_sent == SOCKET_ERROR ){ |
| |
trace( "async_server (%x) exiting\n", id ); | trace( "async_server (%x) exiting\n", id ); |
|
|
// Close the client socket and then close the server | // Close the client socket and then close the server |
// when all clients are done. | // when all clients are done. |
trace( "async_server (%x): close event\n", id ); | trace( "async_server (%x): close event\n", id ); |
closesocket( socket ); |
wsa_ok( closesocket ( socket ), 0 ==, "async_server (%lx): closesocket error: %d\n" ); |
| |
if( --async_params.numClients == 0 ){ | if( --async_params.numClients == 0 ){ |
| |
|
|
| |
// Get the current instance | // Get the current instance |
HINSTANCE instance = GetModuleHandle( NULL ); | HINSTANCE instance = GetModuleHandle( NULL ); |
ok( instance != NULL, "async_server (%x):GetModuleHandle error %ld\n", id, GetLastError() ); |
|
if( instance == NULL ){ | if( instance == NULL ){ |
| |
trace( "async_server (%x) exiting\n", id ); | trace( "async_server (%x) exiting\n", id ); |
|
|
windowClass.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); | windowClass.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); |
windowClass.lpszMenuName = NULL; | windowClass.lpszMenuName = NULL; |
ATOM classAtom = RegisterClass( &windowClass ); | ATOM classAtom = RegisterClass( &windowClass ); |
ok( classAtom != 0, "async_server (%x): RegisterClass error %ld\n", id, GetLastError() ); |
|
if( classAtom == 0 ){ | if( classAtom == 0 ){ |
| |
trace( "async_server (%x) exiting\n", id ); | trace( "async_server (%x) exiting\n", id ); |
|
|
instance, | instance, |
NULL ); | NULL ); |
| |
ok( hwnd != NULL, "async_server (%x): CreateWindowd error %ld\n", id, GetLastError() ); |
|
if( hwnd == NULL ){ | if( hwnd == NULL ){ |
| |
trace ( "async_server (%x) exiting\n", id ); | trace ( "async_server (%x) exiting\n", id ); |
|
|
MSG msg; | MSG msg; |
while( ( retVal = GetMessage( &msg, NULL, 0, 0 ) ) != 0 ){ | while( ( retVal = GetMessage( &msg, NULL, 0, 0 ) ) != 0 ){ |
| |
ok( retVal != -1, "async_server (%x): GetMessage error %ld\n", id, GetLastError() ); |
|
if( retVal == -1 ){ | if( retVal == -1 ){ |
| |
// error: exit | // error: exit |