🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Demos

#4267
From: Michele Santucci
Date: Mon, 14 Mar 2005 12:37
33 lines
2335 bytes
Hello and Thnx,

anyway I fixed my problems rigth now but I noticed a strange behaviour...
I set up my ServerSocket to be stNonBlocking so when the client sends a 
packet to my server the ClientRead event is fired.
Inside my OnClientRead event handler I start reading bytes of the message 
using the ReceiveBuf socket method.
Anything works here but if I call Application->ProcessMessages() somewhere 
in my code before having completly unbuffered received data the OnClientRead 
event is fired again...
That sounds pretty strange to me.

"Hans Galema" <notused@notused.nl> ha scritto nel messaggio 
news:4231ded4@newsgroups.borland.com...
> Michele Santucci wrote:
>
>> are there any reliable example on TSocketClient and TSocketServer usage?
>> I have to write a client server application that exchange binary data 
>> over a TCP network.
>
> Not a comlete client or server. But code to reliably send and receive
> data for blocking as well as non-blocking TServerSocket/TClientSocket
> has been published many times. You can even read some thgreads now in
> this group that contain nice code.
>
>> I did it but I got lots of problems.
>> It seems that after a client write the server got loads of read events 
>> but most of those
>> events dont supply data (ReceiveLength() returns 0).
>
> Don't care for ReceiveLength() == 0 . Then don't read.
>
> Hans. 
Technical Details
Message-ID: <42358583$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4231cced@newsgroups.borland.com> <4231ded4@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,ac22febc451b7e17
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Michele Santucci" <michele.santucci@celinavio.it>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <4231cced@newsgroups.borland.com> <4231ded4@newsgroups.borland.com>
Subject: Re: Demos
Date: Mon, 14 Mar 2005 13:37:23 +0100
Lines: 35
Organization: Celin Avio S.r.l.
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 62.94.122.236
Message-ID: <42358583$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1110803843 62.94.122.236 (14 Mar 2005 04:37:23 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail