home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.protocols.tcp-ip      TCP and IP network protocols.      14,669 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 12,936 of 14,669   
   Rick Jones to SpreadTooThin   
   Re: Too soon to close socket...   
   18 Jun 09 22:34:56   
   
   234e8a83   
   From: rick.jones2@hp.com   
      
   SpreadTooThin  wrote:   
   > I think I have an issue in my server where I transmit data and then   
   > close the socket.  I think the data may not have been sent before   
   > the socket is closed and the client is not happy....  Is there some   
   > way to make sure that the transmit queue is empty before closing the   
   > socket?  Is there a sock option or something?   
      
   Typically, what one does is roughly:   
      
   shutdown(SHUT_WR);   
      
   and then either hang in a recv or a select/poll and wait for a recv   
   return of zero indicating the client has also either called   
   shutdown(SHUT_WR) or close(). If you "know" that the client will not   
   have done so without having first drained the socket at his end, you   
   know then that the data has left the socket at your end.   
      
   rick jones   
   --   
   firebug n, the idiot who tosses a lit cigarette out his car window   
   these opinions are mine, all mine; HP might not want them anyway... :)   
   feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca