[twsocket] subsequent sendstr not sending?

Wilfried Mestdagh wilfried_sonal@compuserve.com
Tue, 27 Jun 2000 10:32:48 +0200


Do you use TWSocket as listening serrver or TWSocketServer ?
Anyway if you pass information with the client (initial login), you have
already an accepted socket. Then you try to accept it again --> that's what
is wrong. The (accepted) socket where you do the initial login with the
client is the one you have to use during the lifetime of the tcp session.

If you wants a separate form for each client you eather create the form when
new session is available, accept the socket and do the initial loging and
the rest of the session, or accept the connection, do the initial login,
then create the form and pass the same object handle to the form's socket.

 Form := TfrmSRVClient.create(self);
 ClientList.Add(Form);  // maintains a list of clients connected
 Form.CliSocket := InitialSocket;

Where 'InitialSocket' is the socket you have accepted to do teh initial

rgds, Wilfried

> -----Original Message-----
> From: twsocket-admin@elists.org [mailto:twsocket-admin@elists.org]On
> Behalf Of Allen A. Maxwell
> Sent: dinsdag 27 juni 2000 2:01
> To: twsocket@elists.org
> Subject: [twsocket] subsequent sendstr not sending?
> HI all,
> I'm new to the list and new to the ICS controls.  Have written a
> client and
> server and am able to establish a connection.  After doing so I have the
> client log in (send password and user name to server) which works
> fine.  The
> server sends back some information for the client to use in populating the
> form - all of this is fine.
> I used the demo to set things up and when the initial connection is made I
> create a new form with a socket on it and the communication to do
> the above
> stuff is done in this form...
> (here's how I'm starting the connection form):
>     Form := TfrmSRVClient.create(self);
>     ClientList.Add(Form);  // maintains a list of clients connected
>     Form.CliSocket.LineMode := TRUE;
>     Form.CliSocket.LineEnd  := #13#10;
>     { Now accept the new client connection }
>     Form.CliSocket.HSocket := SrvSocket.Accept;
>     Form.Show;
> anyway, the probem comes now.. After the initial client form is populated
> the client takes some action and needs to pass some more info to
> the server,
> so the server can respond again.  I call sendstr on the client
> again but it
> never seems to get anywhere.  I've tried putting showmessage()
> statements in
> the events on the server (both the main form and the split off form) but
> they never get called.  I'm sure this is due to something stupid
> on my part
> but if you all could be gentle enough (and bonk me on the head with the
> answer) I'd really appreciate it!  :)
> Thanks in advance.
> Max