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
> 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,
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
-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
> 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
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
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
>> 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
> 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
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
> 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
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
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
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
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
> 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
>
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
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
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
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
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
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
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
> 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
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
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
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://
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
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
> >>> 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
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
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,
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
>> 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
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
> 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
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:
>
<= 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
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
> 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
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
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
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
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
44 matches
Mail list logo