PC Review


Reply
Thread Tools Rate Thread

Cancel asynchrous Socket Read

 
 
Tod Johnson
Guest
Posts: n/a
 
      19th Dec 2004
Hi,

Is possible somehow to cancel BeginRead operation from the socket, when
I try to exit from the program the thread:

System.Net.OSSOCK.recv is hanging and the program after the exit still
exists and locked.


Thank you,
Tod

 
Reply With Quote
 
 
 
 
=?Utf-8?B?Sm9lcmcgTGF1a2VtcGVy?=
Guest
Posts: n/a
 
      18th Feb 2005
Hi Tod,

I have the same problem. Did you find a solution? If yes please let me know.

Thank you in advance.

Joerg

"Tod Johnson" wrote:

> Hi,
>
> Is possible somehow to cancel BeginRead operation from the socket, when
> I try to exit from the program the thread:
>
> System.Net.OSSOCK.recv is hanging and the program after the exit still
> exists and locked.
>
>
> Thank you,
> Tod
>
>

 
Reply With Quote
 
Russ Ryba
Guest
Posts: n/a
 
      18th Feb 2005
Just call EndRead on the socket. It will throw an exception, but it
should clear the socket so you can close it.

- Russ Ryba

Joerg Laukemper wrote:
> Hi Tod,
>
> I have the same problem. Did you find a solution? If yes please let me know.
>
> Thank you in advance.
>
> Joerg
>
> "Tod Johnson" wrote:
>
>
>>Hi,
>>
>>Is possible somehow to cancel BeginRead operation from the socket, when
>>I try to exit from the program the thread:
>>
>>System.Net.OSSOCK.recv is hanging and the program after the exit still
>>exists and locked.
>>
>>
>>Thank you,
>>Tod
>>
>>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Socket: Cancel / Timeout StreamReader.ReadToEnd() Manfred Denzer Microsoft Dot NET Compact Framework 1 31st Jul 2008 08:59 AM
Socket.Available != 0, Socket.Read --> Exception Tomasz Naumowicz Microsoft Dot NET Framework 2 27th Feb 2005 10:27 PM
Socket.Available != 0 but Socket.Read throws an exception Tomasz Naumowicz Microsoft C# .NET 0 24th Feb 2005 03:38 PM
Socket.Available != 0 but Socket.Read throws an exception Tomasz Naumowicz Microsoft C# .NET 0 24th Feb 2005 03:05 PM
How to cancel Async read from socket? John Hynes Microsoft Dot NET Compact Framework 4 27th Oct 2003 09:41 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:40 AM.