🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Inactivity timeouts in sockets?

#2565
From: Remy Lebeau (TeamB)
Date: Mon, 27 Mar 2006 18:12
25 lines
1987 bytes
"Martin" <dev@no.comppromed.spam.com> wrote in message
news:44281b29$1@newsgroups.borland.com...

> The connection that gives me the problem is one that has periods
> where nothing is sent/receive for more than 20 minutes.

Sockets themselves do not have any problems with idle periods.  They don't
care at all whether data is being transmitted frequently or not.  So any
problems you are having are likely caused by problems in your own code that
is managing the sockets.

> The socket is still connected (no disconnect events or errors), but
> later on we find that the other side tried to send something that wasn't
> received by our app.

What does your actual code look like?  Since you are using non-blocking
sockets, my first guess would be that you are not completely clearing the
socket's inbound buffer when data arrives, thus the socket eventually begins
losing notifications when new data arrives.  When data arrives, you have to
read ALL of it at that moment, into your own buffer.  You should not leave
data unread in the socket in between events.


Gambit
Technical Details
Message-ID: <44282b0d$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!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>

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>
Subject: Re: Inactivity timeouts in sockets?
Date: Mon, 27 Mar 2006 10:12:23 -0800
Lines: 27
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: <44282b0d$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1143483149 68.69.17.41 (27 Mar 2006 10:12:29 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail