• Post Reply Bookmark Topic Watch Topic
  • New Topic

Signal Close Connection from Server  RSS feed

 
Angela Jessi
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
How Client will know that Sever is disconnected(without sending any data to the client), so client can close the socket?
Please let me know, (if have code please send me so it will be easy to understand)
Thanks in advance,
Angela
 
maateen ashraf
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello Angela Jessi,
The simplest method to get inforemed about the close connection is just to catch java.net.ConnectException
whenever the server closes the socket created by client on a specific port
catch the exception in client program & do what ever u wanna do on close connection.
plz let me know if u still find some more about this problem....
have nice time

 
Angela Jessi
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks maateen,
I would like to more and if you have any example, please send me.
Thanks again,
Angela
 
maateen ashraf
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
actually i worked on a chat software
in which i just dispayed text strings on TextArea on applet through socket.
i used bufferedReader for efficient reading of data sent by server.

actually my program willn't help u out cuz ur senario is completly different for mine's.
anyhow still i 'll mail u the code for that...
have nive time there
 
Angela Jessi
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks maateen,
Did u use AppendText to add in textarea and read() or readLine()
in BufferReader.
Please let me know,
Thanks again
Have a nice weekend
angela
 
maateen ashraf
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello Angela Jessi,
yea i have extensively used appendText(""),
&
readLine()
plz let me know what sort of help u require for ur software...
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!