Java Client/Server File transfer with Multithreading Problem?

You have a pretty big obvious problem. ServerSocket's accept method returns a new socket every time. In your server code here initSocket = servSock.accept() initSocket is a class member field which means you will over write the old socket and never close it.

You should start a new thread to handle this socket and from what I see it looks like you just keep reusing the same socket. That won't work. Look at tutorials on how to open sockets.

Sorry I can't help more but there is a lot of things going on here that just won't work. Maybe you can start focusing on part of the code and we can help more.

You have a pretty big obvious problem. ServerSocket's accept method returns a new socket every time. In your server code here initSocket = servSock.accept(); initSocket is a class member field which means you will over write the old socket and never close it.

You should start a new thread to handle this socket and from what I see it looks like you just keep reusing the same socket. That won't work. Look at tutorials on how to open sockets.

Sorry I can't help more but there is a lot of things going on here that just won't work. Maybe you can start focusing on part of the code and we can help more.

You have a pretty big obvious problem. ServerSocket's accept method returns a new socket every time. In your server code here.

I agree, it could be a small issue or it could be a big one, some example code would help us aid you, If you try to connect to a server 3 times using the same port you will get an error because you can only have 1 connection per port, the problem could be super simple or very complex, if you edit your post and add your code then we can better help you.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions