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 extra

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,

[twsocket] OnDataAvailable

2012-01-31 Thread MFischer
Hi, i am using the Standard TWSocket in a Server and round about 5 Clients without LineMode. After a Client is connected to the Server, the Client starts immediately to send text messages. After some sort of filtering the messages are broadcasted to a subset of all connected Clients. If i start th

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

2010-02-17 Thread Koker, Mohamed (GE Infra, Energy)
-boun...@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

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

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

Re: [twsocket] OnDataAvailable

2007-04-19 Thread Jonathan Dumaresq
gards Jonathan. - Original Message - From: "Francois PIETTE" <[EMAIL PROTECTED]> To: "ICS support mailing" Sent: Wednesday, April 18, 2007 3:44 PM Subject: Re: [twsocket] OnDataAvailable >>> I would like to know if this is normal to have the eve

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

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 R

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, 16:3

Re: [twsocket] OnDataAvailable

2007-04-18 Thread Angus Robertson - Magenta Systems Ltd
> 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. Also -1 which means an error, which you can get from LastError and convert to ASCII with WSocketErrorDesc. Angus -- To unsubscribe or ch

[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 http://www.elists.org/mailman/li

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 AFla

Re: [twsocket] OnDataAvailable and Reetrancy

2006-08-31 Thread Francois Piette
e, freeware) Author of MidWare (Multi-tier framework, freeware) http://www.overbyte.be - Original Message - From: "Markus Humm" <[EMAIL PROTECTED]> To: Sent: Friday, September 01, 2006 7:25 AM Subject: [twsocket] OnDataAvailable and Reetrancy > > Can OnDataAvai

Re: [twsocket] OnDataAvailable and Reetrancy

2006-08-31 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

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

Re: [twsocket] OnDataAvailable and reetrancy

2006-08-31 Thread Francois PIETTE
TED]> To: Sent: 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 re

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

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 ha

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

2006-08-04 Thread Francois Piette
ED]> To: Sent: Friday, August 04, 2006 9:43 AM Subject: [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/a848b588

[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=st&q=&rnum=1&hl=fr#a848b588964d09a2 F. Piette said to view example : there is bunch of example, the only one i found is the ThrdSr

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

2006-02-20 Thread Wilfried Mestdagh
Hello Jack, > So when I resume, > instead of setting the option, I can still use the Resume() > function to resume notification? I'm not sure I understeand completely what you ask but: - Pause will stop notification from winsock. If there is already data received then OnDataAvailable will keep

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

2006-02-20 Thread Jack
Hello Francois, Thanks for the reply. I'll try that. So when I resume, instead of setting the option, I can still use the Resume() function to resume notification? -- Best regards, Jack Sunday, February 19, 2006, 2:20:54 AM, you wrote: >> I find that calling pause in OnSessionConnected() is ef

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 noti

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

2006-02-19 Thread Arno Garrels
Jack wrote: > 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? You may have paused the server socket instead of the TWSocketClient? Arno Gar

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, 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 http://

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 wil

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

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

2006-01-22 Thread Francois Piette
> >>> 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 You can't ignore OnDataavailable even

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 wi

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

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

2006-01-22 Thread Jack
Hello Francois, >> 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 buffer. This is because I want to >> open a remote socket and make sure it's in wsConnected state, >> then I'll retrieve data and send it through the remot

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 b

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

2006-01-22 Thread Jack
nDataAvailable where Receive return <= 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: >

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: Sent: Sunday, January 22, 2006 5:25 AM Subject: [twsocket] OnDataAvailable called b

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

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 d

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

Re: [twsocket] OnDataAvailable

2005-05-10 Thread Melinda Bellei
I understand it. Thank you. On 5/10/05, Wilfried Mestdagh <[EMAIL PROTECTED]> wrote: > Hello Melinda, > > TWSocketServer has this events (and some others) because it is derrived > from TWSocket. But a server will never get any data. A server create > local data sockets (mostly called Clients, but

Re: [twsocket] OnDataAvailable

2005-05-10 Thread Wilfried Mestdagh
Hello Melinda, TWSocketServer has this events (and some others) because it is derrived from TWSocket. But a server will never get any data. A server create local data sockets (mostly called Clients, but this is confusing sometime). So in OnClientConnect you have a client whitch is also derived fr

[twsocket] OnDataAvailable

2005-05-10 Thread Melinda Bellei
Hi, I'm new with ICS and i'm trying to develop some simple demos for to learn it. TWSocketServer component has the event of OnDataAvailable : procedure TForm1.WServerDataAvailable(Sender: TObject; ErrCode: Word); begin // end; But i couldn't see any parameter about the socket(client) which send