X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a324a7bccf4bda8f4f2bf09daee8104cae953cee..312cd9e93d7c0bf201e52297741e8e12a7298fc9:/src/common/sckipc.cpp diff --git a/src/common/sckipc.cpp b/src/common/sckipc.cpp index 27dae77d32..b9e286ffbf 100644 --- a/src/common/sckipc.cpp +++ b/src/common/sckipc.cpp @@ -35,11 +35,9 @@ #pragma hdrstop #endif -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxTCPServer, wxServerBase) IMPLEMENT_DYNAMIC_CLASS(wxTCPClient, wxClientBase) IMPLEMENT_DYNAMIC_CLASS(wxTCPConnection, wxConnectionBase) -#endif // It seems to be already defined somewhere in the Xt includes. #ifndef __XT__ @@ -60,22 +58,22 @@ enum { #endif void Server_OnRequest(wxSocketServer& server, - GSocketEvent evt, + wxSocketNotify evt, char *cdata); void Client_OnRequest(wxSocketBase& sock, - GSocketEvent evt, + wxSocketNotify evt, char *cdata); // --------------------------------------------------------------------------- // wxTCPClient // --------------------------------------------------------------------------- -wxTCPClient::wxTCPClient (void) +wxTCPClient::wxTCPClient () : wxClientBase() { } -wxTCPClient::~wxTCPClient (void) +wxTCPClient::~wxTCPClient () { } @@ -96,7 +94,7 @@ wxConnectionBase *wxTCPClient::MakeConnection (const wxString& host, wxDataInputStream data_is(*stream); wxDataOutputStream data_os(*stream); - client->SetNotify(GSOCK_INPUT_FLAG | GSOCK_LOST_FLAG); + client->SetNotify(wxSOCKET_INPUT_FLAG | wxSOCKET_LOST_FLAG); addr.Service(server_name); addr.Hostname(host); @@ -135,7 +133,6 @@ wxConnectionBase *wxTCPClient::MakeConnection (const wxString& host, delete client; return NULL; } - return NULL; } wxConnectionBase *wxTCPClient::OnMakeConnection() @@ -147,7 +144,7 @@ wxConnectionBase *wxTCPClient::OnMakeConnection() // wxTCPServer // --------------------------------------------------------------------------- -wxTCPServer::wxTCPServer (void) +wxTCPServer::wxTCPServer () : wxServerBase() { } @@ -162,14 +159,14 @@ bool wxTCPServer::Create(const wxString& server_name) // Create a socket listening on specified port server = new wxSocketServer(addr); server->Callback((wxSocketBase::wxSockCbk)Server_OnRequest); - server->SetNotify(GSOCK_CONNECTION_FLAG); + server->SetNotify(wxSOCKET_CONNECTION_FLAG); server->CallbackData((char *)this); return TRUE; } -wxTCPServer::~wxTCPServer(void) +wxTCPServer::~wxTCPServer() { } @@ -182,17 +179,17 @@ wxConnectionBase *wxTCPServer::OnAcceptConnection( const wxString& WXUNUSED(topi // wxTCPConnection // --------------------------------------------------------------------------- -wxTCPConnection::wxTCPConnection (void) +wxTCPConnection::wxTCPConnection () : wxConnectionBase(), m_sock(NULL), m_sockstrm(NULL), m_codeci(NULL), m_codeco(NULL) { } -wxTCPConnection::wxTCPConnection(char *buffer, int size) +wxTCPConnection::wxTCPConnection(char * WXUNUSED(buffer), int WXUNUSED(size)) { } -wxTCPConnection::~wxTCPConnection (void) +wxTCPConnection::~wxTCPConnection () { wxDELETE(m_sock); wxDELETE(m_codeci); @@ -206,7 +203,7 @@ void wxTCPConnection::Compress(bool WXUNUSED(on)) } // Calls that CLIENT can make. -bool wxTCPConnection::Disconnect (void) +bool wxTCPConnection::Disconnect () { // Send the the disconnect message to the peer. m_codeco->Write8(IPC_DISCONNECT); @@ -215,7 +212,7 @@ bool wxTCPConnection::Disconnect (void) return TRUE; } -bool wxTCPConnection::Execute (wxChar *data, int size, wxIPCFormat format) +bool wxTCPConnection::Execute (const wxChar *data, int size, wxIPCFormat format) { if (!m_sock->IsConnected()) return FALSE; @@ -336,7 +333,7 @@ bool wxTCPConnection::Advise (const wxString& item, return TRUE; } -void Client_OnRequest(wxSocketBase& sock, GSocketEvent evt, +void Client_OnRequest(wxSocketBase& sock, wxSocketNotify evt, char *cdata) { int msg = 0; @@ -348,7 +345,7 @@ void Client_OnRequest(wxSocketBase& sock, GSocketEvent evt, wxString item; // The socket handler signals us that we lost the connection: destroy all. - if (evt == GSOCK_LOST) { + if (evt == wxSOCKET_LOST) { sock.Close(); connection->OnDisconnect(); return; @@ -464,20 +461,20 @@ void Client_OnRequest(wxSocketBase& sock, GSocketEvent evt, } void Server_OnRequest(wxSocketServer& server, - GSocketEvent evt, char *cdata) + wxSocketNotify evt, char *cdata) { wxTCPServer *ipcserv = (wxTCPServer *)cdata; wxSocketStream *stream; wxDataInputStream *codeci; wxDataOutputStream *codeco; - if (evt != GSOCK_CONNECTION) + if (evt != wxSOCKET_CONNECTION) return; /* Accept the connection, getting a new socket */ wxSocketBase *sock = server.Accept(); sock->Notify(FALSE); - sock->SetNotify(GSOCK_INPUT_FLAG | GSOCK_LOST_FLAG); + sock->SetNotify(wxSOCKET_INPUT_FLAG | wxSOCKET_LOST_FLAG); stream = new wxSocketStream(*sock); codeci = new wxDataInputStream(*stream);