/////////////////////////////////////////////////////////////////////////////
// Name: socket.h
// Purpose: Socket handling classes
/////////////////////////////////////////////////////////////////////////////
// Name: socket.h
// Purpose: Socket handling classes
wxSOCKET_INPUT_FLAG = GSOCK_INPUT_FLAG,
wxSOCKET_OUTPUT_FLAG = GSOCK_OUTPUT_FLAG,
wxSOCKET_CONNECTION_FLAG = GSOCK_CONNECTION_FLAG,
wxSOCKET_INPUT_FLAG = GSOCK_INPUT_FLAG,
wxSOCKET_OUTPUT_FLAG = GSOCK_OUTPUT_FLAG,
wxSOCKET_CONNECTION_FLAG = GSOCK_CONNECTION_FLAG,
// Type of request
enum wxSockType { SOCK_CLIENT, SOCK_SERVER, SOCK_INTERNAL, SOCK_UNINIT };
// Type of request
enum wxSockType { SOCK_CLIENT, SOCK_SERVER, SOCK_INTERNAL, SOCK_UNINIT };
protected:
GSocket *m_socket; // wxSocket socket
wxSockFlags m_flags; // wxSocket flags
wxSockType m_type; // wxSocket type
protected:
GSocket *m_socket; // wxSocket socket
wxSockFlags m_flags; // wxSocket flags
wxSockType m_type; // wxSocket type
// Defering variables
enum {
DEFER_READ, DEFER_WRITE, NO_DEFER
} m_defering; // Defering state
char *m_defer_buffer; // Defering target buffer
// Defering variables
enum {
DEFER_READ, DEFER_WRITE, NO_DEFER
} m_defering; // Defering state
char *m_defer_buffer; // Defering target buffer
- wxUint32 m_defer_nbytes; // Defering buffer size
- wxTimer *m_defer_timer; // Timer for defering mode
+ wxUint32 m_defer_nbytes; // Defering buffer size
+ wxTimer *m_defer_timer; // Timer for defering mode
void CreatePushbackAfter(const char *buffer, wxUint32 size);
void CreatePushbackBefore(const char *buffer, wxUint32 size);
void CreatePushbackAfter(const char *buffer, wxUint32 size);
void CreatePushbackBefore(const char *buffer, wxUint32 size);
- // seconds = 0 means no wait
- // seconds > 0 means specified wait
+ // seconds, milliseconds = 0 means no wait
+ // seconds, milliseconds > 0 means specified wait
bool Wait(long seconds = -1, long milliseconds = 0);
bool WaitForRead(long seconds = -1, long milliseconds = 0);
bool WaitForWrite(long seconds = -1, long milliseconds = 0);
bool Wait(long seconds = -1, long milliseconds = 0);
bool WaitForRead(long seconds = -1, long milliseconds = 0);
bool WaitForWrite(long seconds = -1, long milliseconds = 0);
int DeferRead(char *buffer, wxUint32 nbytes);
int DeferWrite(const char *buffer, wxUint32 nbytes);
int DeferRead(char *buffer, wxUint32 nbytes);
int DeferWrite(const char *buffer, wxUint32 nbytes);
- wxSocketBase* Accept();
- bool AcceptWith(wxSocketBase& sock);
+ wxSocketBase* Accept(bool wait = TRUE);
+ bool AcceptWith(wxSocketBase& sock, bool wait = TRUE);
+
+ bool WaitOnAccept(long seconds = -1, long milliseconds = 0);