- enum wxSockFlags { NONE=0, NOWAIT=1, WAITALL=2, SPEED=4 };
- // Type of request
- enum { REQ_READ=0x1, REQ_PEEK=0x2, REQ_WRITE=0x4, REQ_LOST=0x8,
- REQ_ACCEPT=0x10, REQ_CONNECT=0x20};
- enum { EVT_READ=0, EVT_PEEK=1, EVT_WRITE=2, EVT_LOST=3, EVT_ACCEPT=4,
- EVT_CONNECT=5 };
-
- typedef int wxRequestNotify;
- typedef int wxRequestEvent;
- typedef void (*wxSockCbk)(wxSocketBase& sock,wxRequestEvent evt,char *cdata);
-
-protected:
- wxList req_list[EVT_WRITE+1];
-
- // Internal use for SaveState() and RestoreState()
- class wxSockState : public wxObject {
- public:
- bool cbk_on;
- wxSockCbk cbk;
- char *cdata;
- bool notif;
- wxRequestNotify cbk_set;
- wxSockFlags flags;
- };
- typedef struct {
- char sig[4];
- char len[4];
- } SockMsg;
- enum wxSockType { SOCK_CLIENT, SOCK_SERVER, SOCK_INTERNAL, SOCK_UNINIT };
-
- wxSockFlags m_flags;
- wxSockType m_type; // wxSocket type
- bool m_connected, m_connecting; // State of the socket
- int m_fd; // Socket file descriptors
- int m_waitflags; // Wait flags
- wxList m_states; // States list
- wxSockCbk m_cbk; // C callback
- char *m_cdata; // C callback data
- int m_id; // Socket id (for event handler)
- wxSocketHandler *m_handler; // the current socket handler
- wxRequestNotify m_neededreq; // Specify which requet signals we need
- bool m_cbkon;
- char *m_unread; // The unread buf
- size_t m_unrd_size; // The size of the unread buf
- bool m_processing; // To prevent some endless loop
- unsigned long m_timeout;
- int m_wantbuf;
- size_t m_lcount; // Last IO request size
- int m_error; // Last IO error
- bool m_notifyme;
-
- struct wxSockInternal *m_internal; // System specific variables