- if (on_wait == -2)
- return 0;
-
- return on_wait;
-}
-
-void wxSocketHandler::YieldSock()
-{
- wxNode *node;
-
- for (node = socks->First(); node; node = node->Next() )
- {
- wxSocketBase *sock = (wxSocketBase *)node->Data();
-
- sock->SaveState();
-
- sock->SetFlags(wxSocketBase::SPEED);
- if (sock->IsData())
- sock->DoRequests(wxSocketBase::EVT_READ);
- sock->DoRequests(wxSocketBase::EVT_WRITE);
-
- sock->RestoreState();
- }
-}
-
-// --------------------------------------------------------------
-// --------- wxSocketHandler: create and register the socket ----
-// --------------------------------------------------------------
-wxSocketServer *wxSocketHandler::CreateServer(wxSockAddress& addr,
- wxSocketBase::wxSockFlags flags)
-{
- wxSocketServer *serv = new wxSocketServer(addr, flags);
-
- Register(serv);
- return serv;
-}
-
-wxSocketClient *wxSocketHandler::CreateClient(wxSocketBase::wxSockFlags flags)
-{
- wxSocketClient *client = new wxSocketClient(flags);
-
- Register(client);
- return client;
-}
-
-#ifdef __WINDOWS__
-// --------------------------------------------------------------
-// --------- wxSocketHandler: Windows specific methods ----------
-// --------------------------------------------------------------
-
-UINT wxSocketHandler::NewMessage(wxSocketBase *sock)
-{
- internal->firstAvailableMsg++;
- smsg_list->Append(internal->firstAvailableMsg, sock);
- return internal->firstAvailableMsg;
-}
-
-void wxSocketHandler::DestroyMessage(UINT msg)
-{
- wxNode *node = smsg_list->Find(msg);
- delete node;
-}
-
-HWND wxSocketHandler::GetHWND() const
-{
- return internal->sockWin;
-}
-
-#endif
-
-bool wxSocketModule::OnInit()
-{
- wxSocketHandler::master = new wxSocketHandler();
- return TRUE;
-}
-
-void wxSocketModule::OnExit()
-{
- delete wxSocketHandler::master;
- wxSocketHandler::master = NULL;
-}
-
-#ifdef __WXMAC__
-void wxMacProcessSocketEvents() ;
-void wxMacProcessEvents()
-{
- wxMacProcessSocketEvents() ;
- (*GUSISpin)(SP_MISC, 0) ;
-}
-
-void wxMacProcessSocketEvents()
-{
- while ( wxMacNetEventsTop != wxMacNetEventsBottom )
- {
- // consume event at wxMacNetEventsBottom
- wxMacSocketOnRequestProc(wxMacNetEventsReferences[wxMacNetEventsBottom] , wxMacNetEventsEvents[wxMacNetEventsBottom] ) ;
- wxMacNetEventsBottom++ ;
- if ( wxMacNetEventsBottom == kwxMacNetEventsMax )
- wxMacNetEventsBottom = 0 ;
- }
-}
-#endif