I am trying out a few examples with JBossRemoting 2.5 SP1 version. I have the following
piece of code which creates a socket Connector and tries to set a timeout (for the
internal socket accept() call) to 3 seconds:
String uri = "socket://" + serverHost + ":" + port;
| InvokerLocator invokerLocator = new InvokerLocator(uri);
|
| this.remoteConnector = new Connector(invokerLocator);
| this.remoteConnector.create();
|
| ;
| this.remoteConnector.addInvocationHandler("sample", new
MyInvocationHandler());
|
| // SET THE TIMEOUT AND START TO WAIT FOR CLIENTS
| this.remoteConnector.getServerInvoker().setTimeout(3000);
| this.remoteConnector.start();
|
On the client side, i intentionally add a Thread.sleep for 15 seconds, before connecting
to the server:
uri = "socket://" + this.serverHost + ":" + this.port;
| InvokerLocator invokerLocator = new InvokerLocator(uri);
| client= new Client(invokerLocator);
|
| // sleep for 15 sec to test timeout on server
| Thread.sleep(15000);
| // now connect and invoke
| client.connect();
|
| client.invoke("blahblah");
|
|
However, the call to this.remoteConnector.start() on the server never timesout. It just
waits (forever) till the client connects to the server. It does not even timeout after the
default timeout that the documentation mentions:
anonymous wrote : The default timeout value is 60000 for server invokers.
Am i missing something with this timeout feature? I checked the docs and even tried
passing the ServerInvoker.TIMEOUT through the metadata while creating the Connector. Even
that did not work.
I enabled the TRACE level logs of the org.jboss.remoting package to see if i am missing
anything. The logs show this:
20:29:15,979 DEBUG [SocketServerInvoker] SocketServerInvoker[localhost:12345] starting
| 20:29:15,995 DEBUG [SocketServerInvoker] SocketServerInvoker[localhost:12345] created
ServerSocket[addr=/127.0.0.1,port=0,localport=12345]
| 20:29:15,995 TRACE [SocketServerInvoker] SocketServerInvoker[localhost:12345] created
Thread[AcceptorThread[ServerSocket[addr=/127.0.0.1,port=0,localport=12345]],5,main]
| 20:29:15,995 DEBUG [ServerInvoker] SocketServerInvoker[localhost:12345] started for
locator InvokerLocator [socket://localhost:12345/]
| 20:29:15,995 DEBUG [SocketServerInvoker] SocketServerInvoker[localhost:12345] started
| 20:29:15,995 TRACE [SocketServerInvoker]
Thread[AcceptorThread[ServerSocket[addr=/127.0.0.1,port=0,localport=12345]],5,main]
started execution of method run()
| 20:29:15,995 TRACE [SocketServerInvoker] passed through ServerSocketRefresh.release()
| 20:29:15,995 DEBUG [Connector] org.jboss.remoting.transport.Connector@8a0d5d started
| 20:29:15,995 TRACE [SocketServerInvoker]
Thread[AcceptorThread[ServerSocket[addr=/127.0.0.1,port=0,localport=12345]],5,main] is
going to wait on serverSocket.accept()
|
|
Looking at the code in SocketServerInvoker, i don't see the code using the timeout
value. Also i tried looking for testcases in the SVN to see if there is one which tests
the timeout on the server side. But i could not find any. I do see test cases for testing
the client side timeouts.
Am i doing something wrong here? Let me know if additional logs or other piece of code is
required.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4188486#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...