Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

peer to peer client server program  RSS feed

Alexander Cowie
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys wonder if anyone can help me, im trying to write a peer to peer client server application. The app should connect to a server which performs a look up and returns the ip address and port number of the client that holds a particular file(this part works). The client should then send the name of the file to the client that has it, which should then return the file. This part is working to some extent (it connects to the client and sends the name of the file). But i am having trouble receiving the response. For the purpose of testing im just sending a string as the response. The approach i have taken is to run a server in a thread within the client, from the results i have been getting i believe the send method is sending the string, but the thread i written to listen for the incoming response (IncomingSong) is not seeing it. I feel that somehow the response is being sent before the listening thread is active. Please see my code below, i have posted the whole client class apologies if this was not necessary.

Thanks in advance ALex
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!