🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #2478

Re: Inactivity timeouts in sockets?

#2478
From: Remy Lebeau (TeamB)
Date: Wed, 29 Mar 2006 01:34
32 lines
2313 bytes
"Martin" <dev@no.comppromed.spam.com> wrote in message
news:44298fd1$1@newsgroups.borland.com...

> No, it's not overwriting the surrounding memory. And the buffer is
> much bigger than the incoming packets.

That does not mean that the buffer is not filling up, if the application is
not removing data from the buffer faster than it arrives.

> During the timeframe where it's not working, they're sending and
> resending, but no response from us.

How are you verifying that, though?  Did you try using a packet sniffer to
make sure that data is actually reaching your machine?

> When it happened last night, I did not get any of
> the auditing statements from the read event. So
> either no events happened or the underlying recv()
> calls always returned 0.

recv() returns 0 when the socket has been disconnected by the other party.
If there is no data available but the connection is still active, then
recv() will return SOCKET_ERROR and WSAGetLastError() returns
WSAEWOULDBLOCK.

You should be using ReceiveLength() before ReceiveBuf() to make sure that
there is any data available for reading before you attempt to actually read
it.


Gambit
Technical Details
Message-ID: <4429e418$5@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news3.google.com!news.glorb.com!tudelft.nl!txtfeed1.tudelft.nl!feed10.multikabel.net!multikabel.net!feed20.multikabel.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <44281b29$1@newsgroups.borland.com> <44282b0d$1@newsgroups.borland.com> <44285053$1@newsgroups.borland.com> <44287752$1@newsgroups.borland.com> <44298fd1$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,11a7fa37087eb9c
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <44281b29$1@newsgroups.borland.com> <44282b0d$1@newsgroups.borland.com> <44285053$1@newsgroups.borland.com> <44287752$1@newsgroups.borland.com> <44298fd1$1@newsgroups.borland.com>
Subject: Re: Inactivity timeouts in sockets?
Date: Tue, 28 Mar 2006 17:34:11 -0800
Lines: 34
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <4429e418$5@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1143596056 68.69.17.41 (28 Mar 2006 17:34:16 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news3.google.com!news.glorb.com!tudelft.nl!txtfeed1.tudelft.nl!feed10.multikabel.net!multikabel.net!feed20.multikabel.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail