diff options
Diffstat (limited to 'csharp/test/Ice/binding/RemoteCommunicatorI.cs')
-rw-r--r-- | csharp/test/Ice/binding/RemoteCommunicatorI.cs | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/csharp/test/Ice/binding/RemoteCommunicatorI.cs b/csharp/test/Ice/binding/RemoteCommunicatorI.cs index c556cea0dc3..0436be2a480 100644 --- a/csharp/test/Ice/binding/RemoteCommunicatorI.cs +++ b/csharp/test/Ice/binding/RemoteCommunicatorI.cs @@ -20,17 +20,28 @@ public class RemoteCommunicatorI : RemoteCommunicatorDisp_ public override RemoteObjectAdapterPrx createObjectAdapter(string name, string endpts, Ice.Current current) { - string endpoints = endpts; - if(endpoints.IndexOf("-p") < 0) + int retry = 5; + try { - endpoints = _app.getTestEndpoint(_nextPort++, endpoints); + string endpoints = endpts; + if(endpoints.IndexOf("-p") < 0) + { + endpoints = _app.getTestEndpoint(_nextPort++, endpoints); + } + + Ice.Communicator com = current.adapter.getCommunicator(); + com.getProperties().setProperty(name + ".ThreadPool.Size", "1"); + Ice.ObjectAdapter adapter = com.createObjectAdapterWithEndpoints(name, endpoints); + return RemoteObjectAdapterPrxHelper.uncheckedCast( + current.adapter.addWithUUID(new RemoteObjectAdapterI(adapter))); + } + catch(Ice.SocketException) + { + if(--retry == 0) + { + throw; + } } - - Ice.Communicator com = current.adapter.getCommunicator(); - com.getProperties().setProperty(name + ".ThreadPool.Size", "1"); - Ice.ObjectAdapter adapter = com.createObjectAdapterWithEndpoints(name, endpoints); - return RemoteObjectAdapterPrxHelper.uncheckedCast( - current.adapter.addWithUUID(new RemoteObjectAdapterI(adapter))); } public override void |