🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Help using sockets.....

#4110
From: Paul
Date: Wed, 06 Apr 2005 18:15
70 lines
3415 bytes
The problem is that I always get the condition which gives the close socket,
and it 'never' reaches the following snippet.  And it does this when the
client does the send text, so its not 60s timeout related.

                  // Back again to Client
                  pStream->Write( buffer, sizeof(buffer));

I've even closed down my ZoneAlarm firewall just to make sure its not
causing a problem.  I'm running this test on W98SE, and have got all the
latest windows updates.  Its driving me nuts!  It should be so simple.  Any
ideas?

Paul.


"Hans Galema" <notused@notused.nl> wrote in message
news:4254244a$1@newsgroups.borland.com...
> Paul wrote:
> > Right.  I've tried the tutorial and I get the same problem.
>
> Which problem ?
>
> > Every time the
> > server gets data it drops into the client socket close(), snippet below,
> > which is in the TMyServerThread.
> >
> >                if (pStream->Read(buffer, sizeof(buffer)) == 0)
> >                   // (if can't read in 60 seconds) than close the
connection
> >                   ClientSocket->Close();
>
> Well it should only close after 60 seconds. Can you confirm that ?
> And .. If you do not want to close then don't.
>
> > Can I confirm:
> > The client app component (drag + drop onto the form) is "ctNonBlocking"?
>
> Pleas use the right names. You mean: The TClientSocket in this example
> if of type ctNonBlocking ? yes.
>
> > The server app component (drag + drop onto the form) is
"stThreadBlocking"
> > and has an event handler for get thread.
>
> TServerSocket was the name. stThreadBlocking yes.
>
> >
> >
//--------------------------------------------------------------------------
> > -
> > void __fastcall TForm1::ServerSocket1GetThread(TObject *Sender,
> >       TServerClientWinSocket *ClientSocket, TServerClientThread
> > *&SocketThread)
> > {
> >    SocketThread = new TMyServerThread(false, ClientSocket);
> > }
>
> > void __fastcall TForm1::SocketOpenClick(TObject *Sender)
>
> If that is an eventhandler for a TButton then please let the name
> as such when seeking help.
>
> > void __fastcall TForm1::SocketCloseClick(TObject *Sender)
> > {
> >     // close thread blocking socket
> >     ServerSocket1->Active = false;
>   that is not enough I think.
> > }
>
> Hans.
Technical Details
Message-ID: <425426cb$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news2.google.com!newsread.com!news-xfer.newsread.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <425388a2@newsgroups.borland.com> <425396df$1@newsgroups.borland.com> <4254080d$1@newsgroups.borland.com> <42542096$1@newsgroups.borland.com> <4254244a$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,b9337a02b76d7efd
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "Paul" <plmacca@clara.co.uk>
From: "Paul" <plmacca@clara.co.uk>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <425388a2@newsgroups.borland.com> <425396df$1@newsgroups.borland.com> <4254080d$1@newsgroups.borland.com> <42542096$1@newsgroups.borland.com> <4254244a$1@newsgroups.borland.com>
Subject: Re: Help using sockets.....
Date: Wed, 6 Apr 2005 19:15:14 +0100
Lines: 72
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: 81.129.159.104
Message-ID: <425426cb$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1112811211 81.129.159.104 (6 Apr 2005 11:13:31 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news2.google.com!newsread.com!news-xfer.newsread.com!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail