Note that there are some explanatory texts on larger screens.

plurals
  1. POVB.NET 3.5 SocketException on deployment but not on development machine
    text
    copied!<p>I have written an async UDP client to talk to a server at my company. When I run on my developer machine all is well. When I deploy to another machine I get a socket exception on EndReceive the first time I send data over the socket. My dev box is Win7 and I have deployed to both an XP SP3 machine and a Server 2003 R2 machine. Below is the receive code:</p> <pre><code>Private Sub ReceiveCallback(ByVal ar As IAsyncResult) Try ' Retrieve the state object and the client socket from the asynchronous state object.' Dim state As StateObj = CType(ar.AsyncState, StateObj) Dim client As Socket = state.sockArg ' Read data from the remote device.' Dim bytesRead As Integer receiveDone.WaitOne(Timeout.Infinite) bytesRead = client.EndReceive(ar) If bytesRead &gt; 0 Then Dim s As String = Encoding.ASCII.GetString(state.buffer, 0, bytesRead) parsedata(s) End If Catch SockEx As SocketException mlog.Error(String.Format("ID={1} {0} SocketError={2}", SockEx.Message, ID.ToString, SockEx.SocketErrorCode.ToString), SockEx) Catch ox As System.ObjectDisposedException mlog.Warn(String.Format("Object Disposed ID={0}", ID.ToString)) Catch ex As Exception mlog.Error(String.Format("{1} ID={0}", ID.ToString, ex.Message), ex) End Try End Sub 'ReceiveCallback </code></pre> <p>The exception I get is:</p> <p>System.Net.Sockets.SocketException: The I/O operation has been aborted because of either a thread exit or an application request at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult) at RTSPc.Connection.ReceiveCallback(IAsyncResult ar)</p> <p>The SocketException is OperationAborted</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload