Article View: borland.public.cppbuilder.nativeapi
Article #16018Re: WSA????
From: Tharun Pillay
Date: Wed, 04 Jun 2003 08:59
Date: Wed, 04 Jun 2003 08:59
41 lines
2479 bytes
2479 bytes
The server is a form of proxy. Itll recieve a request on one socket, and the server opens a socket to another server, pass the request, recieves the response and forwards back to the client over the socket the client origionally openned (which of course must not close). Here's how it goes: Client connects to server. OnRead, server enqueues a new thread (using our own TSuperThreader). When the time comes for the thread to execute, the thread then parses the request, establishes a connection to the appropriate server, asks for the data and waits. It will wait until a response comes back or times out. Once either happen, the recieved data is then forwarded to the client. Trouble is that we don't know when the *server* must close the connection - we are relying on a timout or the client terminating the connection - which is dodgy. Any ideas, anyone? Tharun "Hans Galema" <j.m.galema.dontusethis@maartens.nl> wrote in message news:3edccfa2$1@newsgroups.borland.com... > Tharun Pillay wrote: > > Hans, I cannot close the socket when SendBuf returns because it is a > > non-blocking server. > > What is the reason ? > > What happens if you add a > > TServerSocket1->Socket->Connections[connectionnr]->Close(); > or a > TServerSocket1->Socket->Close(); > or a > TServerSocket1->Close(); > > or a combination of these, right after ...->SendBuf () ? > > Hans. >
Technical Details
Message-ID:
<3eddb43a@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<3edc7a5c@newsgroups.borland.com> <3edc7f28@newsgroups.borland.com> <3edcb8aa@newsgroups.borland.com> <3edccfa2$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,30c81141f30ce678 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-06-04 02:04:12 PST From: "Tharun Pillay" <tharun@webmail.co.za> Newsgroups: borland.public.cppbuilder.nativeapi References: <3edc7a5c@newsgroups.borland.com> <3edc7f28@newsgroups.borland.com> <3edcb8aa@newsgroups.borland.com> <3edccfa2$1@newsgroups.borland.com> Subject: Re: WSA???? Date: Wed, 4 Jun 2003 10:59:51 +0200 Lines: 43 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 196.15.202.200 Message-ID: <3eddb43a@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1054716986 196.15.202.200 (4 Jun 2003 01:56:26 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail