🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: TClientSocket OnRead event issues

#1889
From: Arnoud
Date: Mon, 25 Sep 2006 12:27
40 lines
2380 bytes
Hi,

I made a similar program with BCB5 connecting to a embedded server
running windows CE. The application has several TClientSocket components
on the form. To communicate with the embedded device I make the
TClientSocket connect and wait for the device to send its identification
data before sending any data to it.

Some of the established connections never trigger any OnRead event,
making the BCB application believe that the device was successfully
connected, but never responded with any data (no matter how many data
the embedded device sends). In this situation sending data to the
embedded device (using SendBuf) works Ok and the winCE application
received the command.

I started to log the TCP traffic and i noticed that the SYN/SYNACK/ACK
handshake appeared to be normal, I could also see the incomming data
from the embedded device.

1.) SYN packet     app->device
2.) SYN ACK packet device->app
3.) ACK packet     app->device
4.) DATA packet    device->app

I logged the following events of a connection that does not trigger any
OnRead event:

1.) OnConnecting()
2.) OnRead() - returning 0 bytes
3.) OnConnect()
4.) Nothing..

Luckilly 95% of all connections work normally. I added a timeout, making
the same TClientSocket component Close and then Connect to the same
device. The retry works fine (mostly)

I have little idea why it happens, anyone have an idea?

Thank you,
-Arnoud
Technical Details
Message-ID: <4517ccaa$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.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: <4508a026@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,6164f1b08fcaf5c2
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Mon, 25 Sep 2006 14:27:12 +0200
From: Arnoud <vult-r@endless-online.com>
User-Agent: Thunderbird 1.5.0.7 (Windows/20060909)
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: Re: TClientSocket OnRead event issues
References: <4508a026@newsgroups.borland.com>
In-Reply-To: <4508a026@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 213.84.81.135
Message-ID: <4517ccaa$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1159187626 213.84.81.135 (25 Sep 2006 05:33:46 -0700)
Lines: 40
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.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