Re: [twsocket] Connection OK but no data

2009-04-22 Thread Francois Piette
 I am using TWSocketServer to listen and connect to Rabbit Controllers
 (clients). I can establish a connection but I do not receive the
subsequent
 strings, nor can I send any strings. The OnSendData event does not even
 trigger when I use the SendStr method of the server instantiated client.
Any
 ideas?

A frequent error is to think about the server socket which is litening.
Connections events such as OnDataAvailable are triggered on behalf of the
socket instanciated by TWSocketServer for a given client (one for each
client).

Have a look at the various server demos availables in ICS (More demos are in
V5 and reusable with mostly no change in V6 and V7).
--
francois.pie...@overbyte.be
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Connection OK but no data

2009-04-22 Thread Alex Greenspan
Hi Francois,

I looked at the example TcpServ1 and it seems pretty straight forward. I
used that as my model. I do understand that the OnDataAvailable event is the
one from the instantiated client socket, which is assigned in the
OnClientConnect event of the server socket. But I can not understand why
that event does not trigger when my remote client sends a string. I tried
adjusting the end of line chars, but nothing seems to work. My client
connects, I get the OnClientConnect event. After that I expect to see a
string come in from the remote client and the OnDataAvailable event (of the
client) to trigger.

I have my application written in much the same way using Indy components,
and it works. This proves to me that the client is  sending out strings as I
expect. But I have other issues with Indy that I want to get away from.

Thanks,

Alex

On Wed, Apr 22, 2009 at 10:37 AM, Francois Piette francois.pie...@skynet.be
 wrote:

  I am using TWSocketServer to listen and connect to Rabbit Controllers
  (clients). I can establish a connection but I do not receive the
 subsequent
  strings, nor can I send any strings. The OnSendData event does not even
  trigger when I use the SendStr method of the server instantiated client.
 Any
  ideas?

 A frequent error is to think about the server socket which is litening.
 Connections events such as OnDataAvailable are triggered on behalf of the
 socket instanciated by TWSocketServer for a given client (one for each
 client).

 Have a look at the various server demos availables in ICS (More demos are
 in
 V5 and reusable with mostly no change in V6 and V7).
 --
 francois.pie...@overbyte.be
 Author of ICS (Internet Component Suite, freeware)
 Author of MidWare (Multi-tier framework, freeware)
 http://www.overbyte.be

 --
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be




-- 
Alex Greenspan
Digital Matrix Corporation
92 Madison Ave.
Hemsptead, NY 11550
USA

tel. +1.516.481.7990
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Connection OK but no data

2009-04-22 Thread Francois PIETTE
 I looked at the example TcpServ1 and it seems pretty straight forward. I
 used that as my model. I do understand that the OnDataAvailable event is 
 the
 one from the instantiated client socket, which is assigned in the
 OnClientConnect event of the server socket. But I can not understand why
 that event does not trigger when my remote client sends a string. I tried
 adjusting the end of line chars, but nothing seems to work. My client
 connects, I get the OnClientConnect event. After that I expect to see a
 string come in from the remote client and the OnDataAvailable event (of 
 the
 client) to trigger.

Do you have turned LineMode TRUE or FALSE ?
First try with FALSE value. In that case you get an OnDataAvailable whatever 
data your client send.
If you turn LineMode to TRUE, then you get OnDataAvailable only when the 
client has sent a complete line. A line is completed when the end of line 
character(s) are received (default to CRLF pair).

As Wilfried said, no event is triggered if the message pump is not working. 
If you do a wait loop (bad idea anyway), you must call 
Application.ProcessMessages so that events are processed. Better to avoid 
wait loop and use events.

--
francois.pie...@overbyte.be
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be