• Post Reply Bookmark Topic Watch Topic
  • New Topic

Client is closed just after connecting to server  RSS feed

 
yogi jogan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a client-server connection in which client is closed just after connecting to server.

what I need is a command in which a client program should connect to the server program and should be disconnected only when the client wants to disconnect not automatically.

I even removed the "client.close();" command to prevent it from closing. but it wont work

the client code is as follows:

The following is the server code:


I KNOW that it closes because the client exits, but have no idea as to how do I stop it from closing.. i.e. what changes do I make to the code to stop it from closing?
Thankyou in advance
 
Henry Wong
author
Sheriff
Posts: 22861
119
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yogi jogan wrote:
I KNOW that it closes because the client exits, but have no idea as to how do I stop it from closing.. i.e. what changes do I make to the code to stop it from closing?


You cannot stop the Operating System from reaping resources when an application exits. Your only option is to *not* have the application exit.

Henry
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!