]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/sckipc.cpp
one of error messages had way too much spaces in it
[wxWidgets.git] / src / common / sckipc.cpp
index 488ea062ba00b11b8fa7a67e0abcdebcebbe595c..c532acbbee6f4fe768fee8a4c295e4e5b589ab98 100644 (file)
 #pragma hdrstop
 #endif
 
-#if wxUSE_SOCKETS
-
 #ifndef WX_PRECOMP
+#include "wx/defs.h"
 #endif
 
+#if wxUSE_SOCKETS 
+
 #include <stdlib.h>
 #include <stdio.h>
 
@@ -41,7 +42,7 @@
 
 IMPLEMENT_DYNAMIC_CLASS(wxTCPServer, wxServerBase)
 IMPLEMENT_DYNAMIC_CLASS(wxTCPClient, wxClientBase)
-IMPLEMENT_DYNAMIC_CLASS(wxTCPConnection, wxConnectionBase)
+IMPLEMENT_CLASS(wxTCPConnection, wxConnectionBase)
 
 // It seems to be already defined somewhere in the Xt includes.
 #ifndef __XT__
@@ -62,11 +63,16 @@ enum {
 #endif
 
 void Server_OnRequest(wxSocketServer& server,
-                     wxSocketNotify evt,
-                     char *cdata);
+                      wxSocketNotify evt,
+                      char *cdata);
 void Client_OnRequest(wxSocketBase& sock,
-                     wxSocketNotify evt,
-                     char *cdata);
+                      wxSocketNotify evt,
+                      char *cdata);
+
+
+// All sockets will be created with the following flags
+
+#define SCKIPC_FLAGS wxSOCKET_NONE
 
 // ---------------------------------------------------------------------------
 // wxTCPClient
@@ -92,7 +98,7 @@ wxConnectionBase *wxTCPClient::MakeConnection (const wxString& host,
                                                const wxString& server_name,
                                                const wxString& topic)
 {
-  wxSocketClient *client = new wxSocketClient();
+  wxSocketClient *client = new wxSocketClient(SCKIPC_FLAGS);
   wxSocketStream *stream = new wxSocketStream(*client);
   wxDataInputStream *data_is = new wxDataInputStream(*stream);
   wxDataOutputStream *data_os = new wxDataOutputStream(*stream);
@@ -164,18 +170,18 @@ wxTCPServer::wxTCPServer ()
 
 bool wxTCPServer::Create(const wxString& server_name)
 {
-  wxIPV4address addr;
   wxSocketServer *server;
 
-  addr.LocalHost();             // GRG
+  // wxIPV4address defaults to INADDR_ANY:0
+  wxIPV4address addr;
   addr.Service(server_name);
 
   // Create a socket listening on specified port
-  server = new wxSocketServer(addr);
+  server = new wxSocketServer(addr, SCKIPC_FLAGS);
   server->Callback((wxSocketBase::wxSockCbk)Server_OnRequest);
   server->CallbackData((char *)this);
   server->SetNotify(wxSOCKET_CONNECTION_FLAG);
-  server->Notify(TRUE);         // GRG
+  server->Notify(TRUE);
 
   return TRUE;
 }