Thread: Sockets

  1. #1
    Registered User ssharish2005's Avatar
    Join Date
    Sep 2005
    Location
    Cambridge, UK
    Posts
    1,732

    Sockets

    Is the there any way of letting the clients know that the server process has been halted, in case the server was aborted on the other end?

    thanks.

    ssharish
    Life is like riding a bicycle. To keep your balance you must keep moving - Einstein

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    If the server exits, won't all the connections close?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    What is your objective? To have your program gracefully acknowledge a server closing? (I.e. you are writing a game and want the clients to be able to reconnect if Billy's dog starts to chew on his Cat-5 cable between his modem and router?)

  4. #4
    Registered User ssharish2005's Avatar
    Join Date
    Sep 2005
    Location
    Cambridge, UK
    Posts
    1,732
    I am sorry; I should have made it a bit clearer. I think problem wouldn't be there if it was implemented in C.

    My server has been implemented in prolog! What happened when the server aborts is that, it closed all the open ports by the server. Or at least it closed down all the port when it restarts and re-opens it back again! But the stream which were opened doesn’t close, the clients are still reading from those open stream. If I manage to close the stream on the server end and when the client reads it from the closed stream it should return -1, which then I could catch that and close the stream on the client end. And make a new connection.

    ssharish
    Life is like riding a bicycle. To keep your balance you must keep moving - Einstein

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Best way to poll sockets?
    By 39ster in forum Networking/Device Communication
    Replies: 3
    Last Post: 07-22-2008, 01:43 PM
  2. Cross platform sockets
    By zacs7 in forum Networking/Device Communication
    Replies: 5
    Last Post: 06-27-2007, 05:16 AM
  3. multiple UDP sockets with select()
    By nkhambal in forum Networking/Device Communication
    Replies: 2
    Last Post: 01-17-2006, 07:36 PM
  4. Raw Sockets and SP2...
    By Devil Panther in forum Networking/Device Communication
    Replies: 11
    Last Post: 08-12-2005, 04:52 AM
  5. Starting window sockets
    By _Cl0wn_ in forum Windows Programming
    Replies: 2
    Last Post: 01-20-2003, 11:49 AM