• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Client-Server problem - closed socket

 
Janis Strautins
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
Im making a client-server program, in which the client requests a file and the server sends it. Everything runs fine, if the file name is hardcoded in the server.. Here is the code for both sides managing the sending, and please, if you have time, could you explain some more? I just started networking, but i need to create this program asap :|

Server part:


Client part:
 
Paul Clapham
Sheriff
Posts: 21322
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You didn't say what you need explained. You only told us that the code worked correctly under certain circumstances, but not what happened otherwise. So I don't see a question here. Perhaps you could ask something specific?
 
Janis Strautins
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is there an error, that the sockets are closed? Luckily i think i found the answer to that, closing a stream associated with a socket, closes the socket, am i right?
Are there any comments, recomendations on the code, it is now fully working, but i want to double check.

Client part:

Server part:


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic