Click here to Skip to main content
15,889,200 members
Home / Discussions / C#
   

C#

 
AnswerRe: Remove instance Pin
Simon P Stevens24-Nov-08 3:05
Simon P Stevens24-Nov-08 3:05 
GeneralRe: Remove instance Pin
RishiKasnia24-Nov-08 16:43
RishiKasnia24-Nov-08 16:43 
QuestionSetting Socket.ReceiveBufferSize Pin
HosamAly24-Nov-08 0:40
HosamAly24-Nov-08 0:40 
AnswerRe: Setting Socket.ReceiveBufferSize Pin
Mark Salsbery24-Nov-08 7:14
Mark Salsbery24-Nov-08 7:14 
GeneralRe: Setting Socket.ReceiveBufferSize Pin
HosamAly24-Nov-08 20:43
HosamAly24-Nov-08 20:43 
GeneralRe: Setting Socket.ReceiveBufferSize Pin
Mark Salsbery25-Nov-08 5:42
Mark Salsbery25-Nov-08 5:42 
Questionsmart card Pin
ellllllllie24-Nov-08 0:34
ellllllllie24-Nov-08 0:34 
QuestionA blocking operation was interrupted by a call to WSACancelBlockingCall Pin
Gareth H24-Nov-08 0:27
Gareth H24-Nov-08 0:27 
I have a TcpClient connection that connects to a local java process. When I close the form, I call dispose on my tcp client handler and kill the java process. However, this is causing the below error:

11:22:01 TcpClientHandler.Read; IOException: System.IO.IOException: Unable to read data from the transport connection: A blocking operation was interrupted by a call to WSACancelBlockingCall. ---> System.Net.Sockets.SocketException: A blocking operation was interrupted by a call to WSACancelBlockingCall
               >>>>    at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
               >>>>    at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
               >>>>    --- End of inner exception stack trace ---
               >>>>    at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
               >>>>    at System.IO.StreamReader.ReadBuffer()
               >>>>    at System.IO.StreamReader.ReadLine()


I am a bit confused as to why this error is being thrown, since when I close the form, the "Reading..." trace is never printed out.

public void Read()
{
    Trace.WriteLine("##debug: Reading...", "INFORMATION");
    try
    {
        do
        {
            _alertMessage = _reader.ReadLine();
            if (!string.IsNullOrEmpty(_alertMessage))
            {
                if (MessageReadEvent != null)
                    MessageReadEvent(this, _alertMessage);
            }
        }
        while (!string.IsNullOrEmpty(_alertMessage));
    }
    catch (IOException io)
    {
        Trace.WriteLine(MethodBase.GetCurrentMethod().DeclaringType.Name + "." + MethodInfo.GetCurrentMethod().Name +
            "; IOException: " + io.ToString(), "ERROR");
    }
}


When I dispose of the tcp client handler I dispose of the reader, and then call tcpClient.Close();

Regards,
Gareth.

(FKA gareth111)

AnswerRe: A blocking operation was interrupted by a call to WSACancelBlockingCall Pin
led mike24-Nov-08 5:02
led mike24-Nov-08 5:02 
GeneralRe: A blocking operation was interrupted by a call to WSACancelBlockingCall Pin
Gareth H24-Nov-08 5:37
Gareth H24-Nov-08 5:37 
GeneralRe: A blocking operation was interrupted by a call to WSACancelBlockingCall Pin
led mike24-Nov-08 5:56
led mike24-Nov-08 5:56 
GeneralRe: A blocking operation was interrupted by a call to WSACancelBlockingCall Pin
Gareth H24-Nov-08 7:24
Gareth H24-Nov-08 7:24 
QuestionCapturing SessionEnding without Main form Pin
__DanC__23-Nov-08 23:21
__DanC__23-Nov-08 23:21 
QuestionThis is about material. I am Mongolia. I don't speak english Pin
Tsodgorhuu23-Nov-08 22:27
Tsodgorhuu23-Nov-08 22:27 
AnswerRe: This is about material. I am Mongolia. I don't speak english Pin
Simon P Stevens23-Nov-08 22:36
Simon P Stevens23-Nov-08 22:36 
GeneralRe: This is about material. I am Mongolia. I don't speak english Pin
Thomas Weller23-Nov-08 22:41
Thomas Weller23-Nov-08 22:41 
GeneralHelp me Pin
Tsodgorhuu23-Nov-08 22:42
Tsodgorhuu23-Nov-08 22:42 
AnswerCross post, please ignore Pin
Giorgi Dalakishvili23-Nov-08 22:40
mentorGiorgi Dalakishvili23-Nov-08 22:40 
AnswerRe: This is about material. I am Mongolia. I don't speak english Pin
Vimalsoft(Pty) Ltd23-Nov-08 22:40
professionalVimalsoft(Pty) Ltd23-Nov-08 22:40 
RantRe: This is about material. I am Mongolia. I don't speak english - no, but you cross post your homework everywhere Pin
Ashfield23-Nov-08 23:01
Ashfield23-Nov-08 23:01 
AnswerRe: This is about material. I am Mongolia. I don't speak english Pin
zenstain10-Nov-11 8:39
professionalzenstain10-Nov-11 8:39 
Question[Message Deleted] Pin
Tsodgorhuu23-Nov-08 22:17
Tsodgorhuu23-Nov-08 22:17 
AnswerRe: Help me Pin
J4amieC23-Nov-08 22:18
J4amieC23-Nov-08 22:18 
Question[I wrote]: hi.. Pin
vinay_K23-Nov-08 22:16
vinay_K23-Nov-08 22:16 
AnswerRe: [I wrote]: hi.. Pin
Simon P Stevens23-Nov-08 22:20
Simon P Stevens23-Nov-08 22:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.