Re: [twsocket] OnDataAvailable

2012-01-31 Thread Angus Robertson - Magenta Systems Ltd
If the ClientSocket is closed, the callback for OnDataAvailable is triggered and the missing Bytes are received. This is the common sympton of missing line endings so the event is never called. But this would not explain why it's suddenly happening. I gave up on LineMode a long time ago, and

Re: [twsocket] OnDataAvailable

2012-01-31 Thread Brian Culverwell
I had a similar problem when converting to XE2 from Delphi7 - my TwSocket component was designed to send a header string containing the length of the data to follow, and then I would read that bit to get the actual data - and then process it - but with XE2 being unicode aware - suddenly I had

[twsocket] OnDataAvailable event not firing for UDP client

2010-02-17 Thread Koker, Mohamed (GE Infra, Energy)
Hi All, I have a udp client for the TFTP protocol that has worked perfectly since I first wrote it in 1999. Recently we upgraded to Delphi 2010 so I also upgraded to the V7 source code. Unfortunately, things no longer work. I can send the initial request packet to the TFTP server (on the same

Re: [twsocket] OnDataAvailable event not firing for UDP client

2010-02-17 Thread Angus Robertson - Magenta Systems Ltd
I have a udp client for the TFTP protocol that has worked perfectly since I first wrote it in 1999. Recently we upgraded to Delphi 2010 so I also upgraded to the V7 source code. Unfortunately, things no longer work. Source written 10 years ago will not be aware of Unicode and will

Re: [twsocket] OnDataAvailable event not firing for UDP client

2010-02-17 Thread Koker, Mohamed (GE Infra, Energy)
...@elists.org] On Behalf Of Angus Robertson - Magenta Systems Ltd Sent: Wednesday, February 17, 2010 10:23 AM To: twsocket@elists.org Subject: Re: [twsocket] OnDataAvailable event not firing for UDP client I have a udp client for the TFTP protocol that has worked perfectly since I first wrote

Re: [twsocket] OnDataAvailable

2007-04-19 Thread Jonathan Dumaresq
Jonathan. - Original Message - From: Francois PIETTE [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Wednesday, April 18, 2007 3:44 PM Subject: Re: [twsocket] OnDataAvailable I would like to know if this is normal to have the event OnDataAvailable trigger and get

[twsocket] OnDataAvailable

2007-04-18 Thread Jonathan Dumaresq
Hi, I would like to know if this is normal to have the event OnDataAvailable trigger and get a RcvdCount = 0 ? I'm using tcp socket with twsocket. i'm on bcb 2006. regards Jonathan -- To unsubscribe or change your settings for TWSocket mailing list please goto

Re: [twsocket] OnDataAvailable

2007-04-18 Thread Wilfried Mestdagh
Hello Jonathan, Yes RcvdCount is not reliable according to Microsoft. You should try to receive anyway and check the returned Count value from the Receive method. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Wednesday, April 18, 2007,

Re: [twsocket] OnDataAvailable

2007-04-18 Thread Francois PIETTE
I would like to know if this is normal to have the event OnDataAvailable trigger and get a RcvdCount = 0 ? Yes, it is normal. Some article in MSDN expalin that RcvdCount (at least the API behind it) is not always reliable. The best strategy in your OnDataAvailable even is to always call

Re: [twsocket] OnDataAvailable

2007-04-18 Thread Francois PIETTE
I would like to know if this is normal to have the event OnDataAvailable trigger and get a RcvdCount = 0 ? 0 length can happen, you must allow for it. Be aware that having RcvdCount = 0 is a different issue than having Receive returning 0. Also -1 which means an error, which you can get

Re: [twsocket] OnDataAvailable and Reetrancy

2006-09-01 Thread Arno Garrels
Markus Humm wrote: I don't call processmessages and the like directly in the event but might output some lines on screen for debugging. How? ShowMessage is a modal form. Other thing: what about critical sections. Would they be safe for preventing this in my situation? No, critical

Re: [twsocket] OnDataAvailable and Reetrancy

2006-09-01 Thread Francois Piette
of MidWare (Multi-tier framework, freeware) http://www.overbyte.be - Original Message - From: Markus Humm [EMAIL PROTECTED] To: twsocket@elists.org Sent: Friday, September 01, 2006 7:25 AM Subject: [twsocket] OnDataAvailable and Reetrancy Can OnDataAvailable be called while

Re: [twsocket] OnDataAvailable and Reetrancy

2006-09-01 Thread Wilfried Mestdagh
But TWSocket will swallow the exception, so use this: var AFlag:Boolean procedure TForm.WSocketDataAvailable(Sender: TObject; ErrCode: Word); begin try if AFlag then raise Exception.Create('reentered'); AFlag := TRUE; try [..] finally

[twsocket] OnDataAvailable and reetrancy

2006-08-31 Thread Markus Humm
Hello, I've a server and a client app. which communicate through a TCP based protocoll I designed. The server get's requests which in OnDataAvailable are received into a 1500 Byte sized array (most time the app. will run on a LAN) whose contents is copied into a larger buffer then since the

Re: [twsocket] OnDataAvailable and reetrancy

2006-08-31 Thread Francois PIETTE
: Thursday, August 31, 2006 8:20 PM Subject: [twsocket] OnDataAvailable and reetrancy Hello, I've a server and a client app. which communicate through a TCP based protocoll I designed. The server get's requests which in OnDataAvailable are received into a 1500 Byte sized array (most time the app

[twsocket] OnDataAvailable and Reetrancy

2006-08-31 Thread Markus Humm
Can OnDataAvailable be called while it is already running? And if yes, how to prevent this? Is using critical sections a good idea here? You must avoid having the events reentered. To avoid this, you simply have to _not_ call any form of the message pump from the events. The message

[twsocket] Twsocket/onDataAvailable in a DLL, called by a Thread

2006-08-04 Thread Crafton
Hello, I'm still stuck with my problems : http://groups.google.fr/group/borland.public.delphi.internet.winsock/browse_frm/thread/d1361882f2bf604a/a848b588964d09a2?lnk=stq=rnum=1hl=fr#a848b588964d09a2 F. Piette said to view example : there is bunch of example, the only one i found is the

Re: [twsocket] Twsocket/onDataAvailable in a DLL, called by a Thread

2006-08-04 Thread Francois Piette
: [twsocket] Twsocket/onDataAvailable in a DLL, called by a Thread Hello, I'm still stuck with my problems : http://groups.google.fr/group/borland.public.delphi.internet.winsock/browse_frm/thread/d1361882f2bf604a/a848b588964d09a2?lnk=stq=rnum=1hl=fr#a848b588964d09a2 F. Piette said to view

Re: [twsocket] Twsocket/onDataAvailable in a DLL, called by a Thread

2006-08-04 Thread Wilfried Mestdagh
Hello, TWSocket has a method 'MessageLoop'. You only have to call this one because it is pumping messages until WM_QUIT is posted to it. To execute TWSocket in thread context you have to do this in Execute method of thread: - Create it in Execute method of thread - Assign properties and event

Re: [twsocket] OnDataAvailable called before shutdown with no data

2006-02-19 Thread Francois PIETTE
I find that calling pause in OnSessionConnected() is effective. But calling pause in OnClientDataAvailable() does not work. OnClientDataAvailable() keeps getting fired. Any ideas? Maybe your socket already received data when you pause it. Pause only affect winsock notification. It stops

Re: [twsocket] OnDataAvailable called before shutdown with no data

2006-02-18 Thread Jack
Hello Francois, I find that calling pause in OnSessionConnected() is effective. But calling pause in OnClientDataAvailable() does not work. OnClientDataAvailable() keeps getting fired. Any ideas? -- Best regards, Jack Sunday, January 22, 2006, 10:33:21 AM, you wrote: Maybe use Pause/Resume ?

Re: [twsocket] OnDataAvailable non-lined mode question

2006-02-13 Thread Wilfried Mestdagh
Hello Dod, Using line mode OFF, if I do for example a .Send of 500 bytes, the receiver should get just one OnDataAvailable event. Mostly, but not for sure. You can also receive more bytes if the sender sends a second packet a little later. TCP does not respect packet boundary. If it will

Re: [twsocket] OnDataAvailable non-lined mode question

2006-02-13 Thread Wilfried Mestdagh
Hello Dod, Maybe another apprach is to use always a timeout and reset it every time data is received. But then you have to send keep alive packets to not get disconnected in case there is no real traffic needed. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html

Re: [twsocket] OnDataAvailable called before shutdown with no data

2006-01-23 Thread Jack
Hello Francois, You can't ignore OnDataavailable event ! Got it. There is a flag FPaused but it is not exposed as a property. Oh, will you be able to expose it? I can modify the source code for now but I think it's useful when Pause and Resume is exposed. Not really. You can have a

Re: [twsocket] OnDataAvailable called before shutdown with no data

2006-01-22 Thread Francois PIETTE
= 0. -- Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] http://www.overbyte.be - Original Message - From: Jack [EMAIL PROTECTED] To: twsocket@elists.org Sent: Sunday, January 22, 2006 5:25 AM Subject: [twsocket] OnDataAvailable called before

Re: [twsocket] OnDataAvailable called before shutdown with no data

2006-01-22 Thread Jack
. -- Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] http://www.overbyte.be - Original Message - From: Jack [EMAIL PROTECTED] To: twsocket@elists.org Sent: Sunday, January 22, 2006 5:25 AM Subject: [twsocket] OnDataAvailable called

Re: [twsocket] OnDataAvailable called before shutdown with no data

2006-01-22 Thread Francois PIETTE
Is there a way to tell the number of bytes available without actually retrieving the data? There is RcvdCount but due to winsock limitation, it is not always accurate. At some point I'd like to know if there is data available but do not want to actually remove the data from twsocket's

Re: [twsocket] OnDataAvailable called before shutdown with no data

2006-01-22 Thread Francois PIETTE
Maybe use Pause/Resume ? Oh, I didn't even know these two methods. So Pause will stop all network connectivity on that socket until it's resumed? It suppress async notification. So you don't receive events anymore but I/O continue as much as winsock can, for example filling his receive

Re: [twsocket] OnDataAvailable called before shutdown with no data

2006-01-22 Thread Jack
Hello Francois, Maybe use Pause/Resume ? It suppress async notification. So you don't receive events anymore but I/O continue as much as winsock can, for example filling his receive buffer. Got it. Wouldn't this be similar to ignoring OnDataAvailable event and is vulnerable to DOS attack?

Re: [twsocket] OnDataAvailable called before shutdown with no data

2006-01-22 Thread Wilfried Mestdagh
Hello Jack, if there is data available but do not want to actually remove the data from twsocket's buffer. This is because I want to You can use Pauze / Resume but there is also a very simple way to do it, just set wsoNoReceiveLoop in SocketOptions to True and dont Receive in OnDataAvailable,

Re: [twsocket] OnDataAvailable called before shutdown with no data

2006-01-22 Thread Wilfried Mestdagh
Hello Jack, It suppress async notification. So you don't receive events anymore but I/O continue as much as winsock can, for example filling his receive buffer. Got it. Wouldn't this be similar to ignoring OnDataAvailable event and is vulnerable to DOS attack? If you call Pauze then winsock

[twsocket] OnDataAvailable called before shutdown with no data

2006-01-21 Thread Jack
Hello Francois and all, I use telnet as client to connect to a twsocketserver, after connecting to it, without sending any data from the client (do not type anything in telnet) I call shutdown(1) on all the client sockets. After this, although there is no data received, the client socket's

[twsocket] OnDataAvailable event question

2005-12-19 Thread lame.one
I was wondering about something concerning the OnDataAvailable event for Twsocket. If I assign a string to the receivestr function inside the OnDataAvailable event and I have lengthy processing do i miss other OnDataAvailable events and my string clears during the reassignment or is the data

Re: [twsocket] OnDataAvailable event question

2005-12-19 Thread Francois Piette
I was wondering about something concerning the OnDataAvailable event for Twsocket. If I assign a string to the receivestr function inside the OnDataAvailable event and I have lengthy processing do i miss other OnDataAvailable events and my string clears during the reassignment or is the data