You can use simple p2p architecture.
this, this , , , this.
:
Socket s = new Socket(IP,PORT);
s.connect();
DataOutputStream dos = new DataOutputStream(s.getOutputStream());
dos.write("hello".toByteArray());
:
ServerSocket ss = new ServerSocket(PORT);
Socket s = ss.accept(); //This call will block execution, use separate thread
DataInputStream dis = new DataInputStream(s.getInputStream);
byte[] data = dis.read();
, , .
, , /, /.
, .