This content has been marked as final. Show 3 replies
Create a singelton pattern for you socket ( IP, port, etc..) and each time you read the input stream and write to the output stream, do the following to the socket to reset it in the working thread
Hope this could help
Will it reset the Server Socket thread or Client Socket ? Because in my case multiple socket connections is getting created at the client side where I used to create the Client Socket. Because the variable "fromclient" is used to accept the connections from the server socket. Is that I have to use the variable "clientsoc" for that ?
Apart from the fact that this will certainly throw a MarkNotSupportedException, I am completely unable to see the point of this suggestion.
@OP: if you only want one socket, I suggest you only create one socket.