From 387cdaf2f4e054376f4e0e50a048464051878aa6 Mon Sep 17 00:00:00 2001 From: Guillermo Rodriguez Garcia Date: Mon, 27 Mar 2000 19:40:37 +0000 Subject: [PATCH] Use 'localhost' directly instead of wxGetHostName, which sometimes does not do the right thing. This change doesn't affect DDE classes, which ignore this argument anyway. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@6961 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/ipc/client.cpp | 13 ++++++++----- samples/ipc/server.cpp | 9 +++++---- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/samples/ipc/client.cpp b/samples/ipc/client.cpp index 4cabdc42cb..9b694cc696 100644 --- a/samples/ipc/client.cpp +++ b/samples/ipc/client.cpp @@ -74,11 +74,14 @@ MyClient *my_client ; // main frame bool MyApp::OnInit() { - wxString server = "4242"; - wxString hostName = wxGetHostName(); + // service name (DDE classes) or port number (TCP/IP based classes) + wxString service = "4242"; + + // ignored under DDE, host name in TCP/IP based classes + wxString hostName = "localhost"; if (argc > 1) - server = argv[1]; + service = argv[1]; if (argc > 2) hostName = argv[2]; @@ -88,7 +91,7 @@ bool MyApp::OnInit() // suppress the log messages from MakeConnection() { wxLogNull nolog; - the_connection = (MyConnection *)my_client->MakeConnection(hostName, server, "IPC TEST"); + the_connection = (MyConnection *)my_client->MakeConnection(hostName, service, "IPC TEST"); while ( !the_connection ) { @@ -100,7 +103,7 @@ bool MyApp::OnInit() return FALSE; } - the_connection = (MyConnection *)my_client->MakeConnection(hostName, server, "IPC TEST"); + the_connection = (MyConnection *)my_client->MakeConnection(hostName, service, "IPC TEST"); } } diff --git a/samples/ipc/server.cpp b/samples/ipc/server.cpp index 820bdefc8a..ea43bda9a6 100644 --- a/samples/ipc/server.cpp +++ b/samples/ipc/server.cpp @@ -72,14 +72,15 @@ bool MyApp::OnInit() // Create the main frame window (new MyFrame(NULL, "Server"))->Show(TRUE); - // create the server object - wxString server_name = "4242"; + // service name (DDE classes) or port number (TCP/IP based classes) + wxString service = "4242"; + if (argc > 1) - server_name = argv[1]; + service = argv[1]; // Create a new server m_server = new MyServer; - m_server->Create(server_name); + m_server->Create(service); return TRUE; }