Winsock.ocx | After GetData, DataArrival gets fired immediatelly (loop) 
Author Message
 Winsock.ocx | After GetData, DataArrival gets fired immediatelly (loop)

Hi

Will use the System.Net.Sockets someday but for now must use winsock control
in VB.NET...

The problem is that after catching the DataArrival event, a call is made to
GetData but as soon as that line executes DataArrival fires again giving no
chance to the remaining code to execute... How to overcome this please?

Cheers
Daniel



Sun, 03 Oct 2004 22:21:04 GMT  
 Winsock.ocx | After GetData, DataArrival gets fired immediatelly (loop)
Hi

Will use the System.Net.Sockets someday but for now must use winsock control
in VB.NET...

The problem is that after catching the DataArrival event, a call is made to
GetData but as soon as that line executes DataArrival fires again giving no
chance to the remaining code to execute... How to overcome this please?

Cheers
Daniel



Mon, 04 Oct 2004 00:35:48 GMT  
 Winsock.ocx | After GetData, DataArrival gets fired immediatelly (loop)
Do you get the same behavior using the winsock control in VB6?

 Thank You,
 Dale Roberson
 Microsoft Developer Support

 This posting is provided "AS IS" with no warranties, and confers no rights.
 You assume all risk for your use. ? 2001 Microsoft Corporation. All rights
reserved.



Mon, 04 Oct 2004 20:10:32 GMT  
 Winsock.ocx | After GetData, DataArrival gets fired immediatelly (loop)
No.. this code has been running fine in VB6 for ages...

In VB6, after calling GetData the following lines execute and when all code
has finished execution the DataArrival event is thrown again from the
Winsock... My first guess is that this is a threading issue (cause I blame
all my upgrade probs on the free threaded model;-) i.e. after getting the
data from winsock, the control just fires its event but because there is no
apartment 'protection' in VB.NET the callback is not queued and just comes
in.. (..or something like that...)

Any ideas?

Cheers
Daniel



Quote:
> Do you get the same behavior using the winsock control in VB6?

>  Thank You,
>  Dale Roberson
>  Microsoft Developer Support

>  This posting is provided "AS IS" with no warranties, and confers no
rights.
>  You assume all risk for your use. ? 2001 Microsoft Corporation. All
rights
> reserved.



Tue, 05 Oct 2004 17:22:30 GMT  
 Winsock.ocx | After GetData, DataArrival gets fired immediatelly (loop)
Not off the top of my head.  I'll check with some folks who actually
support that control and get them to take a look.

 Thank You,
 Dale Roberson
 Microsoft Developer Support

 This posting is provided "AS IS" with no warranties, and confers no rights.
 You assume all risk for your use. ? 2001 Microsoft Corporation. All rights
reserved.



Tue, 05 Oct 2004 20:09:58 GMT  
 Winsock.ocx | After GetData, DataArrival gets fired immediatelly (loop)
Daniel,

Well, I checked with our Networking Developer Support Team and they
informed me that the old Winsock control is not supported in the .NET
environment.  Guess there are just too many issues with using this control
under interop conditions.  So, it looks like you will need to use the
System.Net.Sockets namespace to implement a solution or look for a 3rd
party alternative.

 Thank You,
 Dale Roberson
 Microsoft Developer Support

 This posting is provided "AS IS" with no warranties, and confers no rights.
 You assume all risk for your use. ? 2001 Microsoft Corporation. All rights
reserved.



Wed, 06 Oct 2004 00:29:08 GMT  
 Winsock.ocx | After GetData, DataArrival gets fired immediatelly (loop)
Thank you



Quote:
> Daniel,

> Well, I checked with our Networking Developer Support Team and they
> informed me that the old Winsock control is not supported in the .NET
> environment.  Guess there are just too many issues with using this control
> under interop conditions.  So, it looks like you will need to use the
> System.Net.Sockets namespace to implement a solution or look for a 3rd
> party alternative.

>  Thank You,
>  Dale Roberson
>  Microsoft Developer Support

>  This posting is provided "AS IS" with no warranties, and confers no
rights.
>  You assume all risk for your use. ? 2001 Microsoft Corporation. All
rights
> reserved.



Wed, 06 Oct 2004 00:42:19 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Winsock DataArrival, socket closing and can't GetData before receiving all the data

2. Winsock - DataArrival fires before Connect

3. Winsock - DataArrival fires before Connect

4. Only most recent winsock connection gets dataarrival.

5. In DataArrival GetData and BytesTotal mismatch

6. DataArrival Event not Firing

7. dataArrival fired when peer is closing the connection

8. winsock GetData

9. problem with winsock getdata

10. winsock.GetData

11. Winsock GetData, bytes and variants

12. SOLUTION to 8K Winsock GetData problem

 

 
Powered by phpBB® Forum Software