Bugs in Winsock Control (?) 
Author Message
 Bugs in Winsock Control (?)

In addition another major bug is in the Winsock Control (according to me):

Suppose:
- the remote host disconnects
- there is still data in the local buffer

Then:
- the state of the control changes to 8
- the data arrival event is triggered
- the get data method caused a trappable error

So:
- data is lost !

This occurs on fast lines when retrieving a web document. The server sends
the contents and disconnects immediately. The Microsoft Control loses the
last part of the contents!

Leander



Quote:

> Hello everyone,

> I have this question about Microsfot Winsock control. It seems to me that
> it has a major bug. This happens when you try to read incoming TCP
traffic
> using the Data Arrival event. What is happening to me is that while this
> event is fired b/c some data is available and I am inside my event
handler,
> if there is more data coming, the event handler gets called again. If we
> get packets fast, this event handler could get called many times. To me
> this is wrong. I think the event handler should be a synchronized method
> (in Java terminology). This causes a lot of headaches and make the
control
> useless in more complicated cases.

> I have talked to microsoft support. They say we dont say it won't get
> called more than once in the documentation! They also suggested that I
use
> some flags which really does not help at all. Even if I use flags to mark
> that the event handler is already executing, there is no use. I can not
> choose not to process the data if the flag is set. The data must be
> processed no matter what the flag says. The problem is not why it is
fired
> more than once. Rather, it is it must be called as a protected (synced)
> function sequentially.

> This is especially a major bug to me b/c there is no way to read part of
> the incoming data in binary format. I must read all of the data or I lose
> the rest. So I need to do my own streaming. But I cannot. Use of any
global
> data structures to do my own streaming make the handlers non-reenterant.
> The event handlers should be reenterant so I cannot use any globals.

> I am wondering what you people think. If any of you has used the control,
> how do you take care of the case where packets are coming fast. Of couse,
> everything works fine when you send and then receive single small
packets.

> Regards,

> -Jalil

----------------------------------------------------------------------------

- Show quoted text -

Quote:
> ---------------------------------------------------------------



> 425 Broadway                         415.569.5241 (voice)
> Redwood City, CA 94063          888.300.1638 (pager)
> http://www.*-*-*.com/ ;  415.569.5101  (fax)

> ----------------------------------------------------------------------



Sun, 17 Oct 1999 03:00:00 GMT  
 Bugs in Winsock Control (?)

Since we are in the Winsock control bashing mode...

It also doesn't like to let go of system resources, when running Win95,
when you load and unload the control to create new sockets in the case of a
server :(

Running the sample code from books on-line will bring a system down to
nothing with about 1000 hits! You have to kill the app and start it again
to get your system resources back.

Try this: Don't have anything else important running just in case. You can
get your system resources back if you close VB, or your app if it is
compiled. Seems to be fine running on NT though. Just happens in Win95.

Set the Index property = 0, in the properties box, at design time, to
create a control array.

    Dim iCount As Integer

                                      For iCount = 1 To 1000

          Load Winsock1(1)
                      Unload Winsock1(1)

    Next

The Dolphin control is a little more work to set up but it has worked good
for me!

Tom Ingoglia
Training Asscociates
www.trainingassociates.com


ouse.net>...

Quote:
>In addition another major bug is in the Winsock Control (according to
me):

>Suppose:
>- the remote host disconnects
>- there is still data in the local buffer

>Then:
>- the state of the control changes to 8
>- the data arrival event is triggered
>- the get data method caused a trappable error

>So:
>- data is lost !

>This occurs on fast lines when retrieving a web document. The server
sends
>the contents and disconnects immediately. The Microsoft Control loses the
>last part of the contents!

>Leander



>> Hello everyone,

>> I have this question about Microsfot Winsock control. It seems to me
that
>> it has a major bug. This happens when you try to read incoming TCP
>traffic
>> using the Data Arrival event. What is happening to me is that while
this
>> event is fired b/c some data is available and I am inside my event
>handler,
>> if there is more data coming, the event handler gets called again. If
we
>> get packets fast, this event handler could get called many times. To me
>> this is wrong. I think the event handler should be a synchronized
method
>> (in Java terminology). This causes a lot of headaches and make the
>control
>> useless in more complicated cases.

>> I have talked to microsoft support. They say we dont say it won't get
>> called more than once in the documentation! They also suggested that I
>use
>> some flags which really does not help at all. Even if I use flags to
mark
>> that the event handler is already executing, there is no use. I can not
>> choose not to process the data if the flag is set. The data must be
>> processed no matter what the flag says. The problem is not why it is
>fired
>> more than once. Rather, it is it must be called as a protected (synced)
>> function sequentially.

>> This is especially a major bug to me b/c there is no way to read part
of
>> the incoming data in binary format. I must read all of the data or I
lose
>> the rest. So I need to do my own streaming. But I cannot. Use of any
>global
>> data structures to do my own streaming make the handlers non-reenterant.
>> The event handlers should be reenterant so I cannot use any globals.

>> I am wondering what you people think. If any of you has used the
control,
>> how do you take care of the case where packets are coming fast. Of
couse,
>> everything works fine when you send and then receive single small
>packets.

>> Regards,

>> -Jalil

>---------------------------------------------------------------------------
-

>> ---------------------------------------------------------------



>> 425 Broadway                         415.569.5241 (voice)
>> Redwood City, CA 94063          888.300.1638 (pager)
>> http://hafez.home.net/jalilweb    415.569.5101  (fax)

>> ----------------------------------------------------------------------



Tue, 19 Oct 1999 03:00:00 GMT  
 Bugs in Winsock Control (?)

I also found the winsock control seems to buffer its out-going data for
undetermined period of time before actually send them out.

For my case, my echo server has a winsock control array.When my 1st client
connects to the server and send some text. 1st client can see its echo. Then
if 2nd client connects up and send some text. 2nd client will see the result
but not the 1st one. Until the 3rd client connects, 1st client will see the
message sent by 2nd client. Then when 3rd client sends message, the 1st and
2nd client won't see the message until 4th clinet connects up.

It drives me mad.
I use TCP/IP winsock

Anyone has idea?

Thanks
Ericsson Mak

Quote:

>In addition another major bug is in the Winsock Control (according to me):

>Suppose:
>- the remote host disconnects
>- there is still data in the local buffer

>Then:
>- the state of the control changes to 8
>- the data arrival event is triggered
>- the get data method caused a trappable error

>So:
>- data is lost !

>This occurs on fast lines when retrieving a web document. The server sends
>the contents and disconnects immediately. The Microsoft Control loses the
>last part of the contents!

>Leander



>> Hello everyone,

>> I have this question about Microsfot Winsock control. It seems to me that
>> it has a major bug. This happens when you try to read incoming TCP
>traffic
>> using the Data Arrival event. What is happening to me is that while this
>> event is fired b/c some data is available and I am inside my event
>handler,
>> if there is more data coming, the event handler gets called again. If we
>> get packets fast, this event handler could get called many times. To me
>> this is wrong. I think the event handler should be a synchronized method
>> (in Java terminology). This causes a lot of headaches and make the
>control
>> useless in more complicated cases.

>> I have talked to microsoft support. They say we dont say it won't get
>> called more than once in the documentation! They also suggested that I
>use
>> some flags which really does not help at all. Even if I use flags to mark
>> that the event handler is already executing, there is no use. I can not
>> choose not to process the data if the flag is set. The data must be
>> processed no matter what the flag says. The problem is not why it is
>fired
>> more than once. Rather, it is it must be called as a protected (synced)
>> function sequentially.

>> This is especially a major bug to me b/c there is no way to read part of
>> the incoming data in binary format. I must read all of the data or I lose
>> the rest. So I need to do my own streaming. But I cannot. Use of any
>global
>> data structures to do my own streaming make the handlers non-reenterant.
>> The event handlers should be reenterant so I cannot use any globals.

>> I am wondering what you people think. If any of you has used the control,
>> how do you take care of the case where packets are coming fast. Of couse,
>> everything works fine when you send and then receive single small
>packets.

>> Regards,

>> -Jalil

>---------------------------------------------------------------------------
-

>> ---------------------------------------------------------------



>> 425 Broadway                         415.569.5241 (voice)
>> Redwood City, CA 94063          888.300.1638 (pager)
>> http://hafez.home.net/jalilweb    415.569.5101  (fax)

>> ----------------------------------------------------------------------



Sun, 24 Oct 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Bugs in Winsock Control (?)

2. Bugs in Winsock Control (?)

3. Any help on avoiding 'memory leak' bug in winsock control?

4. Winsock Control Bug

5. Winsock control (sp2) memory bug!

6. Winsock Control Bug?!?

7. VB5 / MS-Winsock control: event firing bug?

8. Winsock control (sp2) memory bug!

9. winsock control/bug

10. VB6 Winsock Control vs. Winsock API

11. Winsock Control Error 2 winsock.listen

12. WinSock control CPU hog and gimme WinSock API! :)

 

 
Powered by phpBB® Forum Software