How can I tunnel tcp with java?

0

The idea is this:
Create a classe that keeps an eye on the eventos of socket client and when it receives data to classe it redirects to the client that is connected in app. how to do this in java?

    
asked by anonymous 09.12.2014 / 05:16

1 answer

0
  

Create a class that keeps an eye on socket client events

Create a class that implements Runnable , this class must have a Scanner created from InputStream of the "socket client" that receives client information in an "infinite" loop, this information is handled and .. .

  

When it receives data the class redirects (redirects what?) to the client that is connected in the app.

... sends the data to the client using PrintStream from OutputStream "client socket".

This workaround works only with sockets. But I've never worked with sockets and servlets at the same time, but it should be the same logic.

This link explains very well how working with sockets

    
03.09.2015 / 05:45