(file) Return to wsock32_main.c CVS log (file) (dir) Up to [RizwankCVS] / wine4 / wine / dlls / wsock32 / tests

Diff for /wine4/wine/dlls/wsock32/tests/wsock32_main.c between version 1.5 and 1.6

version 1.5, 2005/02/21 19:30:18 version 1.6, 2005/02/21 21:18:43
Line 43 
Line 43 
 #endif #endif
  
 #define NUM_CLIENTS 5 #define NUM_CLIENTS 5
   // amount of data to transfer from each client to server
   #define TRANSFER_SIZE 1000000
  
 struct TestParams { struct TestParams {
         int serverSock;         int serverSock;
Line 57 
Line 59 
 }; };
  
 static void test_Startup(void); static void test_Startup(void);
 void BlockingClient();  void BlockingClient(int *serverPort);
 void BlockingServer();  void BlockingServer(int *port);
 static void test_ClientServerBlocking_1(void); static void test_ClientServerBlocking_1(void);
 static void test_Startup(void); static void test_Startup(void);
  
Line 92 
Line 94 
         addr->sin_port = tmpAddr.sin_port;         addr->sin_port = tmpAddr.sin_port;
 } }
  
 void BlockingClient()  void BlockingClient(int *serverPort)
 { {
         SOCKET sock;         SOCKET sock;
         SOCKADDR_IN client;          SOCKADDR_IN client, server;
           HOSTENT *hp;
         StartNetworkApp(SOCK_STREAM, &sock, &client);         StartNetworkApp(SOCK_STREAM, &sock, &client);
  
           hp = gethostbyname("localhost");
   
           while(*serverPort == 0) ;
   
         // network code here         // network code here
           server.sin_family = AF_INET;
           server.sin_addr = *(struct in_addr *) hp->h_addr;
           server.sin_port = *serverPort;
  
         trace("blocking client done\n");         trace("blocking client done\n");
 } }
  
 void BlockingServer()  void BlockingServer(int *port)
 { {
         SOCKET sock;         SOCKET sock;
         SOCKADDR_IN server;         SOCKADDR_IN server;
         StartNetworkApp(SOCK_STREAM, &sock, &server);         StartNetworkApp(SOCK_STREAM, &sock, &server);
           *port = server.sin_port;
  
         // network code here         // network code here
  
Line 116 
Line 127 
  
 static void test_ClientServerBlocking_1(void) static void test_ClientServerBlocking_1(void)
 { {
           int serverPort = 0;
   HANDLE Thread1, Thread2;   HANDLE Thread1, Thread2;
   DWORD ThreadId1, ThreadId2;   DWORD ThreadId1, ThreadId2;
   Thread1 = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) &BlockingClient, NULL, 0, &ThreadId1);    Thread1 = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) &BlockingClient, &serverPort, 0, &ThreadId1);
   Thread2 = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) &BlockingServer, NULL, 0, &ThreadId2);    Thread2 = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) &BlockingServer, &serverPort, 0, &ThreadId2);
         trace("test_ClientServerBlocking_1 done\n");         trace("test_ClientServerBlocking_1 done\n");
 } }
  


Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

Rizwan Kassim
Powered by
ViewCVS 0.9.2