-#ifdef __WXMAC__
-
-extern "C" int updatestatus(int s) ;
-
-void wxMacSocketOnRequestProc( void *refcon , short event )
-{
- if ( refcon )
- {
- wxSocketBase *sock = (wxSocketBase *) refcon ;
-
- wxSocketBase::wxRequestEvent sk_req;
-
- int canRead ;
- int canWrite ;
- int exception ;
-
- switch (event) {
- case FD_READ:
- sk_req = wxSocketBase::EVT_READ;
- sock->OnRequest(sk_req);
- break;
- case FD_WRITE:
- sk_req = wxSocketBase::EVT_WRITE;
- sock->OnRequest(sk_req);
- break;
- case FD_CLOSE:
- sk_req = wxSocketBase::EVT_LOST;
- sock->OnRequest(sk_req);
- break;
- case FD_ACCEPT:
- sk_req = wxSocketBase::EVT_ACCEPT;
- sock->OnRequest(sk_req);
- break;
- case FD_CONNECT:
- sk_req = wxSocketBase::EVT_CONNECT;
- sock->OnRequest(sk_req);
- break;
- case FD_READY :
- break ;
- }
- updatestatus ( sock->m_fd ) ;
- }
-}
-
-void wxMacSocketHandlerProc( void *refcon , short event )
-{
- wxMacNetEventsReferences[wxMacNetEventsTop] = refcon ;
- wxMacNetEventsEvents[wxMacNetEventsTop] = event ;
-
- // clumsy construct in order to never have a incorrect wxMacNetEventsTop (above limits)
-
- if ( wxMacNetEventsTop + 1 == kwxMacNetEventsMax )
- wxMacNetEventsTop = 0 ;
- else
- wxMacNetEventsTop++ ;
-}
-
-#endif
-#ifdef __WINDOWS__
-
-extern char wxPanelClassName[];
-
-LRESULT APIENTRY _EXPORT wxSocketHandlerWndProc(HWND hWnd, UINT message,
- WPARAM wParam, LPARAM lParam)
-{
- if(message==WM_DESTROY)
- {
- ::SetWindowLong(hWnd, GWL_WNDPROC, (LONG) DefWindowProc);
- return DefWindowProc(hWnd, message, wParam, lParam);
- }
- wxSocketHandler *h_sock = (wxSocketHandler *)GetWindowLong(hWnd, GWL_USERDATA);
- wxNode *node = h_sock->smsg_list->Find(message);
- wxSocketBase *sock;
- wxSocketBase::wxRequestEvent sk_req;
- UINT event = WSAGETSELECTEVENT(lParam);
-
- if (!node)
- return DefWindowProc(hWnd, message, wParam, lParam);
-
- sock = (wxSocketBase *)node->Data();
-
- switch (event) {
- case FD_READ:
- sk_req = wxSocketBase::EVT_READ;
- break;
- case FD_WRITE:
- sk_req = wxSocketBase::EVT_WRITE;
- break;
- case FD_CLOSE:
- sk_req = wxSocketBase::EVT_LOST;
- break;
- case FD_ACCEPT:
- sk_req = wxSocketBase::EVT_ACCEPT;
- break;
- case FD_CONNECT:
- sk_req = wxSocketBase::EVT_CONNECT;
- break;
-
- default:
- wxFAIL_MSG("invalid socket event");
- return (LRESULT)0;
- }
-
- sock->OnRequest(sk_req);
-
- return (LRESULT)0;
-}
-
-FARPROC wxSocketSubClassProc = NULL;
-
-#endif
-