Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

Client is closed just after connecting to server

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 23909
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic