Re: [twsocket] Problem with DataAvailable (similar) [fixed]

2013-03-26 Thread Arno Garrels
Pascal Chapon wrote:
 Okay, everything is fine if I do it with a PostMessage and process
 the non-blocking loop in a separate procedure. 

Yes, that is the solution.
Not to call the message pump in event handlers is one of the 
Ten Coding Commandments, not just in ICS.

-- 
Arno 
 

--
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] Problem with DataAvailable (similar)

2013-03-25 Thread Pascal Chapon
Argh...

Well, not directly in the dataAvailable itself, but it happens in certain cases 
of the function decoding the string (and which is called at the end of the 
dataAvailable).
Thing is, the situation is tricky, cause there's at least one case where I must 
enter in a non-blocking loop where I send one given command several times to 
the client, waiting for a particular type of answer to occur from the client 
side (these happen with no problem at all).

Now, in fact I see that - I call the application.processMessages a last time 
(after the end of the non-blocking loop), and it's probably that call which 
creates the strange behavior in the very next dataAvailable event. I'm gonna 
try without this last call to app.ProcessMessages, I'll keep you up (not at the 
company yet...).

Is the only theoritically proper solution to handle this kind of mandatory 
discussion with a separate thread?

Pascal


Objet : Re: [twsocket] Problem with DataAvailable (similar)

Pascal Chapon wrote:
 Any idea?

Do you call the message pump directly or indirectly, for instance, 
Application.ProcessMessages or ShowMessage() in one of the ICS event handlers?

--
Arno



--
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] Problem with DataAvailable (similar) [fixed]

2013-03-25 Thread Pascal Chapon
Okay, everything is fine if I do it with a PostMessage and process the 
non-blocking loop in a separate procedure.

Many thanks to Arno,

Pascal

--
Argh...

Well, not directly in the dataAvailable itself, but it happens in certain cases 
of the function decoding the string (and which is called at the end of the 
dataAvailable).
Thing is, the situation is tricky, cause there's at least one case where I must 
enter in a non-blocking loop where I send one given command several times to 
the client, waiting for a particular type of answer to occur from the client 
side (these happen with no problem at all).

Now, in fact I see that - I call the application.processMessages a last time 
(after the end of the non-blocking loop), and it's probably that call which 
creates the strange behavior in the very next dataAvailable event. I'm gonna 
try without this last call to app.ProcessMessages, I'll keep you up (not at the 
company yet...).

Is the only theoritically proper solution to handle this kind of mandatory 
discussion with a separate thread?

Pascal


Objet : Re: [twsocket] Problem with DataAvailable (similar)

Pascal Chapon wrote:
 Any idea?

Do you call the message pump directly or indirectly, for instance, 
Application.ProcessMessages or ShowMessage() in one of the ICS event handlers?

--
Arno



--
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


[twsocket] Problem with DataAvailable (similar)

2013-03-23 Thread Pascal Chapon
Hi,

I've found this message in the Feb 2013 archives, and as I experience a similar 
problem (although in LineMode), I gave a try to the wsoNoReceiveLoop option.

Unfortunately, the problem still persists.

I must add that, just before being stuck exactly like Robert below, so on the 
very previous DataAvailable event, what I receive is truncated - at the 
beginning of the string, and up to whatever character we use to separate the 
command name from is parameters (we tried both ':' and '|' separation 
characters, and whatever the size of what is before it, we lose it). We used 
TcpTrace between client and server to ascertain that everything was actually 
received from the client, and that's actually the case (even after 
DataAvailable stops firing).

Example of truncated string:
- expected string (and actually received when through TcpTrace): 
INFO:data1;data2;data3;data4...
- received string (both with ReceiveStr or Receive function): 
:data1;data2;data3;data4...

We tried different numbers of stars, and also the pipe instead of the colon, 
same behavior...

Very weird...

Any idea?

Pascal

Robert Dorn wrote:
 Hello
 
 (sorry, my english is not soo good ;) )
 
 I have a client and a server program and i use binary mode. The
 communication between the both programs
 works great. But after a few time one of the programs no longer call
 the OnDataAvailable event. But still sending  on both programs. the
 program thats no longer call OnDataAvailable, has RcvdCount  0  or
 up to 8192. 
 
 Any idea whats the problem are is?

I guess you should include wsoNoReceiveLoop in the ComponentOptions 
property.

--
--
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] Problem with DataAvailable (similar)

2013-03-23 Thread Arno Garrels
Pascal Chapon wrote:
 Any idea?

Do you call the message pump directly or indirectly,
for instance, Application.ProcessMessages or ShowMessage()
in one of the ICS event handlers?

-- 
Arno


--
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


[twsocket] Problem with DataAvailable

2013-02-09 Thread Robert Dorn

Hello

(sorry, my english is not soo good ;) )

I have a client and a server program and i use binary mode. The  
communication between the both programs
works great. But after a few time one of the programs no longer call the  
OnDataAvailable event. But still sending  on both programs. the program  
thats no longer call OnDataAvailable, has RcvdCount  0  or up to 8192.


Any idea whats the problem are is?



With best greets from germany :)
--
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] Problem with DataAvailable

2013-02-09 Thread Arno Garrels
Robert Dorn wrote:
 Hello
 
 (sorry, my english is not soo good ;) )
 
 I have a client and a server program and i use binary mode. The
 communication between the both programs
 works great. But after a few time one of the programs no longer call
 the OnDataAvailable event. But still sending  on both programs. the
 program thats no longer call OnDataAvailable, has RcvdCount  0  or
 up to 8192. 
 
 Any idea whats the problem are is?

I guess you should include wsoNoReceiveLoop in the ComponentOptions 
property.

-- 
Arno 
--
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