Ignore:
Timestamp:
Dec 3, 1999, 2:19:56 AM (26 years ago)
Author:
phaller
Message:

Add: created separate thread and message queue for WSOCK processign

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wsock32/new/wsock32.cpp

    r1951 r1952  
    1 /* $Id: wsock32.cpp,v 1.11 1999-12-02 21:35:29 phaller Exp $ */
     1/* $Id: wsock32.cpp,v 1.12 1999-12-03 01:19:56 phaller Exp $ */
    22
    33/*
     
    4747#include <win32wnd.h>
    4848
     49
    4950#include "wsock32.h"
    5051#include "relaywin.h"
     
    6465
    6566static HWND hwndRelay = NULL; // handle to our relay window
     67
     68
     69/*****************************************************************************
     70 * Prototypes                                                                *
     71 *****************************************************************************/
     72
     73void __stdcall SetLastError(DWORD dwError);
    6674
    6775
     
    202210               int,iError)
    203211{
     212  // according to the docs, WSASetLastError() is just a call-through
     213  // to SetLastError()
    204214  WSASetLastError(iError);
     215  SetLastError(iError);
    205216}
    206217
     
    220231ODINFUNCTION0(int,OS2WSAGetLastError)
    221232{
     233  // according to the docs, WSASetLastError() is just a call-through
     234  // to SetLastError(). However, what can be implemented here?
    222235  return WSAGetLastError();
    223236}
     
    11671180
    11681181  // add entry to list, we need to store both our temp buffer and the apps buffer
    1169   ulNewID = RelayAlloc(hWnd, 
    1170                        wMsg, 
    1171                        FALSE, 
     1182  ulNewID = RelayAlloc(hWnd,
     1183                       wMsg,
     1184                       FALSE,
    11721185                       ASYNCREQUEST_GETSERVBYNAME,
    11731186                       buf);
     
    11801193                              buf,
    11811194                              buflen);
    1182  
     1195
    11831196  // if an error occurs, free the allocated relay entry
    11841197  if (rc == SOCKET_ERROR)
    11851198    RelayFree(ulNewID);
    11861199
    1187   return (rc);   
     1200  return (rc);
    11881201}
    11891202
     
    12171230
    12181231  // add entry to list, we need to store both our temp buffer and the apps buffer
    1219   ulNewID = RelayAlloc(hWnd, 
    1220                        wMsg, 
    1221                        FALSE, 
     1232  ulNewID = RelayAlloc(hWnd,
     1233                       wMsg,
     1234                       FALSE,
    12221235                       ASYNCREQUEST_GETSERVBYPORT,
    12231236                       buf);
     
    12301243                             buf,
    12311244                             buflen);
    1232  
     1245
    12331246  // if an error occurs, free the allocated relay entry
    12341247  if (rc == SOCKET_ERROR)
    12351248    RelayFree(ulNewID);
    1236  
    1237   return rc; 
     1249
     1250  return rc;
    12381251}
    12391252
     
    12661279
    12671280  // add entry to list, we need to store both our temp buffer and the apps buffer
    1268   ulNewID = RelayAlloc(hWnd, 
    1269                        wMsg, 
    1270                        FALSE, 
     1281  ulNewID = RelayAlloc(hWnd,
     1282                       wMsg,
     1283                       FALSE,
    12711284                       ASYNCREQUEST_GETPROTOBYNAME,
    12721285                       buf);
     
    12781291                              buf,
    12791292                              buflen);
    1280  
     1293
    12811294  // if an error occurs, free the allocated relay entry
    12821295  if (rc == SOCKET_ERROR)
    12831296    RelayFree(ulNewID);
    12841297
    1285   return (rc); 
     1298  return (rc);
    12861299}
    12871300
     
    13141327
    13151328  // add entry to list, we need to store both our temp buffer and the apps buffer
    1316   ulNewID = RelayAlloc(hWnd, 
    1317                        wMsg, 
    1318                        FALSE, 
     1329  ulNewID = RelayAlloc(hWnd,
     1330                       wMsg,
     1331                       FALSE,
    13191332                       ASYNCREQUEST_GETPROTOBYNUMBER,
    13201333                       buf);
     
    13261339                                buf,
    13271340                                buflen);
    1328  
     1341
    13291342  // if an error occurs, free the allocated relay entry
    13301343  if (rc == SOCKET_ERROR)
    13311344    RelayFree(ulNewID);
    1332  
     1345
    13331346  return rc;
    13341347}
     
    13621375
    13631376  // add entry to list, we need to store both our temp buffer and the apps buffer
    1364   ulNewID = RelayAlloc(hWnd, 
    1365                        wMsg, 
    1366                        FALSE, 
    1367                        ASYNCREQUEST_GETHOSTBYNAME, 
     1377  ulNewID = RelayAlloc(hWnd,
     1378                       wMsg,
     1379                       FALSE,
     1380                       ASYNCREQUEST_GETHOSTBYNAME,
    13681381                       buf);
    13691382
     
    13741387                             buf,
    13751388                             buflen);
    1376  
     1389
    13771390  // if an error occurs, free the allocated relay entry
    13781391  if (rc == SOCKET_ERROR)
    13791392    RelayFree(ulNewID);
    1380  
     1393
    13811394  return rc;
    13821395}
     
    14121425
    14131426  // add entry to list, we need to store both our temp buffer and the apps buffer
    1414   ulNewID = RelayAlloc(hWnd, 
    1415                        wMsg, 
    1416                        FALSE, 
     1427  ulNewID = RelayAlloc(hWnd,
     1428                       wMsg,
     1429                       FALSE,
    14171430                       ASYNCREQUEST_GETHOSTBYADDR,
    14181431                       buf);
     
    14261439                             buf,
    14271440                             buflen);
    1428  
     1441
    14291442  // if an error occurs, free the allocated relay entry
    14301443  if (rc == SOCKET_ERROR)
     
    15061519  else
    15071520    // add entry to list
    1508     ulNewID = RelayAlloc(hWnd, 
    1509                          wMsg, 
     1521    ulNewID = RelayAlloc(hWnd,
     1522                         wMsg,
    15101523                         TRUE,
    15111524                         ASYNCREQUEST_SELECT);
Note: See TracChangeset for help on using the changeset viewer.