[jboss-user] [Remoting] - Socket client with JBoss Remoting

riannuzzi do-not-reply at jboss.com
Sun Jul 29 21:48:27 EDT 2007


I'm trying to make a simple socket client using JBoss Remoting. My code is the following:

InvokerLocator locator = new InvokerLocator("socket://127.0.0.1:4322");
Client remotingClient = new Client(locator);
remotingClient.connect();
System.out.println(remotingClient.invoke("Teste Remoting"));

I have a server socket that does not use JBoss Remoting. The code is the following:

server  = new ServerSocket(4322);
client = server.accept();
in = new BufferedReader(new InputStreamReader(client.getInputStream()));
out = new PrintWriter(client.getOutputStream(), true);
while(true){ 
   String line = in.readLine();
    if (line != null){
      System.out.println("Server - Recebendo:" + line);
      out.println("Resposta:" + line);
      System.out.println("Server - Enviando:" + line);
    }
}

But the following exception occurs:
Can not get connection to server. Problem establishing socket connection for InvokerLocator.

Someone can help me?

   	      

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4068582#4068582

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4068582



More information about the jboss-user mailing list