Re: send() was hold when sending message with Bolcking mode

From: Barry Margolin (barmar_at_alum.mit.edu)
Date: 12/10/04

  • Next message: Barry Margolin: "Re: efficiency of fstat calls?"
    Date: Thu, 09 Dec 2004 19:30:54 -0500
    
    

    In article <cp9oft$n0s$1@news.yaako.com>, "Ethan Yu" <ycy_76@163.net>
    wrote:

    > Hi,
    >
    > In my case, send() function is used for sending server message by client and
    > the socket's mode is Blocking. When the server broke down, the client still
    > sent message because it didn't know the server was down. After a while, the
    > send() was hold and couldn't be recovered.
    > When the socket uses blocking mode, how to recover the blocked send()?

    You can use alarm() to send a signal if send() blocks for too long. Or
    use select() to check whether the socket is writable.

    -- 
    Barry Margolin, barmar@alum.mit.edu
    Arlington, MA
    *** PLEASE post questions in newsgroups, not directly to me ***
    

  • Next message: Barry Margolin: "Re: efficiency of fstat calls?"

    Relevant Pages

    • Blocking client and NIO server (Write back to the client issue)
      ... I have to develop a NIO server which can handle hundreds J2ME clients. ... The clients has no NIO capabilities and use blocking reading/writing ... I have no trouble to send msg from the client to the server ... On the client side, for reading data from the server, I did that: ...
      (comp.lang.java.programmer)
    • Re: Blocking client and NIO server (Write back to the client issue)
      ... I have to develop a NIO server which can handle hundreds J2ME clients. ... The clients has no NIO capabilities and use blocking reading/writing ... I have no trouble to send msg from the client to the server ... On the client side, for reading data from the server, I did that: ...
      (comp.lang.java.programmer)
    • Re: Bug in winsock send?
      ... Have you looked to see if the Nagel algorithm is blocking your output? ... to the server, similarly server sends a status message every ... The client is on Windows while the server is Linux. ... All TCP and UDP ...
      (microsoft.public.win32.programmer.networks)
    • Re: blocking non blocking
      ... read and learnt about blocking and non blocking, ... acive for as long as the client is connected. ... My server would definitely be dual core, ... The other model that can deal with lots of sockets is asynchronous ...
      (microsoft.public.win32.programmer.networks)
    • Re: pop and smtp errors unique to machine
      ... > His post doesn't indicate the client is trying SSL. ... > 4) corporate firewall may be blocking the host from reaching the pop/smtp ... > server (this one is easy to check for. ... > address that represents the POP/SMTP server, then there is a device on the ...
      (microsoft.public.windowsxp.network_web)