1

I have a Client socket running on my Android application to send files to the Server socket running on the PC, via Wi-Fi. Everything works fine to this point. I would also like to create another thread within the same android application that acts as a server to receive any files sent from the PC (which runs a client as a separate thread). Is this two way communication possible over java sockets within the same application?

Abhishek Sharma
  • 609
  • 1
  • 11
  • 22
  • Why wouldn't it be possible, what are your doubts? – lc2817 Nov 02 '11 at 19:11
  • 2
    Are you aware that a `Socket` holds a full duplex (TCP) connection? This means that you can both send and receive via a Socket. Use `Socket.getInputStream()` and `Socket.getOutputStream()`. – Thomas Nov 02 '11 at 19:28

0 Answers0