You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by jb...@apache.org on 2017/09/03 20:11:25 UTC
[geode-native] branch develop updated: GEODE-3558: Use TCP IPC
channel only.
This is an automated email from the ASF dual-hosted git repository.
jbarrett pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git
The following commit(s) were added to refs/heads/develop by this push:
new 1b8efdb GEODE-3558: Use TCP IPC channel only.
1b8efdb is described below
commit 1b8efdbd8826d050c11175f9a5e6e615da0e7606
Author: Jacob Barrett <jb...@pivotal.io>
AuthorDate: Sun Sep 3 02:49:42 2017 +0000
GEODE-3558: Use TCP IPC channel only.
- Removes named pipe IPC channel.
---
tests/cli/DUnitFramework/IClientServerComm.cs | 3 --
tests/cli/DUnitFramework/UnitProcess.cs | 52 +++++++++++----------------
tests/cli/FwkClient/ClientProcess.cs | 17 ++-------
tests/cli/FwkLauncher/LauncherProcess.cs | 1 -
4 files changed, 23 insertions(+), 50 deletions(-)
diff --git a/tests/cli/DUnitFramework/IClientServerComm.cs b/tests/cli/DUnitFramework/IClientServerComm.cs
index cc559f7..1d2f56e 100644
--- a/tests/cli/DUnitFramework/IClientServerComm.cs
+++ b/tests/cli/DUnitFramework/IClientServerComm.cs
@@ -258,10 +258,7 @@ namespace Apache.Geode.DUnitFramework
public static class CommConstants
{
public const string ClientService = "Client";
- public const string ClientIPC = "localClientIPCPort";
-
public const string DriverService = "Driver";
- public const string ServerIPC = "localServerIPCPort";
public const string BBService = "BlackBoard";
public const string BBAddrEnvVar = "CSFWK_BBADDR";
public const string DriverAddrEnvVar = "CSFWK_DRIVERADDR";
diff --git a/tests/cli/DUnitFramework/UnitProcess.cs b/tests/cli/DUnitFramework/UnitProcess.cs
index 62b6b5d..50705a0 100644
--- a/tests/cli/DUnitFramework/UnitProcess.cs
+++ b/tests/cli/DUnitFramework/UnitProcess.cs
@@ -25,7 +25,6 @@ using System.Reflection;
using System.Runtime.InteropServices;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
-using System.Runtime.Remoting.Channels.Ipc;
using System.Runtime.Remoting.Channels.Tcp;
using System.Runtime.Serialization.Formatters;
using System.Text;
@@ -103,8 +102,7 @@ namespace Apache.Geode.DUnitFramework
// NOTE: This is required so that remote client receives custom exceptions
RemotingConfiguration.CustomErrorsMode = CustomErrorsModes.Off;
- RegisterChannel(true);
- RegisterChannel(false);
+ RegisterChannel();
RemotingConfiguration.RegisterWellKnownServiceType(typeof(DriverComm),
CommConstants.DriverService, WellKnownObjectMode.SingleCall);
@@ -119,29 +117,19 @@ namespace Apache.Geode.DUnitFramework
#region Private functions
- private static void RegisterChannel(bool ipc)
+ private static void RegisterChannel()
{
- BinaryServerFormatterSinkProvider serverProvider =
- new BinaryServerFormatterSinkProvider();
+ var serverProvider = new BinaryServerFormatterSinkProvider();
serverProvider.TypeFilterLevel = TypeFilterLevel.Full;
- BinaryClientFormatterSinkProvider clientProvider =
- new BinaryClientFormatterSinkProvider();
- Dictionary<string, string> properties = new Dictionary<string, string>();
- IChannel channel;
- if (ipc)
- {
- properties["portName"] = CommConstants.ServerIPC + Util.DriverPort.ToString();
- properties["name"] = "GFIpcChannel";
- channel = new IpcChannel(properties, clientProvider, serverProvider);
- }
- else
- {
- properties["port"] = Util.DriverPort.ToString();
- properties["name"] = "GFTcpChannel";
- channel = new TcpChannel(properties, clientProvider, serverProvider);
- }
- ChannelServices.RegisterChannel(channel, false);
+ var clientProvider = new BinaryClientFormatterSinkProvider();
+
+ var properties = new Dictionary<string, string>();
+ properties["port"] = Util.DriverPort.ToString();
+ properties["name"] = "GFTcpChannel";
+
+ var channel = new TcpChannel(properties, clientProvider, serverProvider);
+ ChannelServices.RegisterChannel(channel, false);
}
private void ExitClient(int waitMillis, bool force)
@@ -238,23 +226,23 @@ namespace Apache.Geode.DUnitFramework
public UnitProcess(string clientId, string startDir)
{
- string clientIPC = CommConstants.ClientIPC + GetClientPort().ToString();
- if (clientId == null)
+ int clientPort = GetClientPort();
+ if (clientId == null)
{
clientId = GetClientId().ToString();
}
this.ID = clientId;
- string localArgs = "--id=" + clientId + " --driver=ipc://" +
- CommConstants.ServerIPC + Util.DriverPort + '/' +
+ string localArgs = "--id=" + clientId + " --driver=tcp://" +
+ Util.IPAddressString + ':' + Util.DriverPort + '/' +
CommConstants.DriverService + " --bbServer=";
if (Util.ExternalBBServer != null)
{
- localArgs += Util.ExternalBBServer + ' ' + clientIPC;
+ localArgs += Util.ExternalBBServer + ' ' + clientPort;
}
else
{
- localArgs += "ipc://" + CommConstants.ServerIPC + Util.DriverPort +
- '/' + CommConstants.BBService + ' ' + clientIPC;
+ localArgs += "tcp://" + Util.IPAddressString + ':' + Util.DriverPort +
+ '/' + CommConstants.BBService + ' ' + clientPort;
}
lock (((ICollection)ProcessIDMap).SyncRoot)
{
@@ -281,8 +269,8 @@ namespace Apache.Geode.DUnitFramework
ClientProcName);
}
- m_clientComm = ServerConnection<IClientComm>.Connect("ipc://" +
- clientIPC + '/' + CommConstants.ClientService);
+ m_clientComm = ServerConnection<IClientComm>.Connect("tcp://" +
+ Util.IPAddressString + ':' + clientPort + '/' + CommConstants.ClientService);
m_timeout = false;
m_exiting = false;
m_startDir = startDir;
diff --git a/tests/cli/FwkClient/ClientProcess.cs b/tests/cli/FwkClient/ClientProcess.cs
index 386c328..e573c54 100644
--- a/tests/cli/FwkClient/ClientProcess.cs
+++ b/tests/cli/FwkClient/ClientProcess.cs
@@ -20,7 +20,6 @@ using System.Collections.Generic;
using System.IO;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
-using System.Runtime.Remoting.Channels.Ipc;
using System.Runtime.Remoting.Channels.Tcp;
using System.Runtime.Serialization.Formatters;
@@ -58,18 +57,9 @@ namespace Apache.Geode.Client.FwkClient
#region Create the communication channel to receive commands from server
properties = new Dictionary<string, string>();
- if (clientPort.GetType() == typeof(int))
- {
- properties["port"] = clientPort.ToString();
- clientChannel = new TcpChannel(properties, clientProvider, serverProvider);
- //Util.Log("Registering TCP channel: " + clientPort);
- }
- else
- {
- properties["portName"] = clientPort.ToString();
- clientChannel = new IpcChannel(properties, clientProvider, serverProvider);
- //Util.Log("Registering IPC channel: " + clientPort);
- }
+ properties["port"] = clientPort.ToString();
+ clientChannel = new TcpChannel(properties, clientProvider, serverProvider);
+ //Util.Log("Registering TCP channel: " + clientPort);
ChannelServices.RegisterChannel(clientChannel, false);
RemotingConfiguration.RegisterWellKnownServiceType(typeof(ClientComm),
@@ -103,7 +93,6 @@ namespace Apache.Geode.Client.FwkClient
}
string procName = Util.ProcessName;
Util.Log("Usage: " + procName + " [OPTION] <client port>");
- Util.Log("If <client port> is a string then IPC is used else TCP at the given port number");
Util.Log("Options are:");
Util.Log(" --id=ID \t\t ID of the client; process ID is used when not provided");
Util.Log(" --driver=URL \t The URL (e.g. tcp://<host>:<port>/<service>) of the Driver");
diff --git a/tests/cli/FwkLauncher/LauncherProcess.cs b/tests/cli/FwkLauncher/LauncherProcess.cs
index 6c39ec0..9721bcf 100644
--- a/tests/cli/FwkLauncher/LauncherProcess.cs
+++ b/tests/cli/FwkLauncher/LauncherProcess.cs
@@ -20,7 +20,6 @@ using System.Collections.Generic;
using System.IO;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
-using System.Runtime.Remoting.Channels.Ipc;
using System.Runtime.Remoting.Channels.Tcp;
using System.Runtime.Serialization.Formatters;
--
To stop receiving notification emails like this one, please contact
['"commits@geode.apache.org" <co...@geode.apache.org>'].