Skip to content

Commit

Permalink
[Socket] Fix invalid cast
Browse files Browse the repository at this point in the history
	Fix invalid cast when canceling pending operations due to socket.Close.
  • Loading branch information
gonzalop committed Feb 11, 2011
1 parent 9d4b9c5 commit d65f4ad
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mcs/class/System/System.Net.Sockets/Socket.cs
Expand Up @@ -153,7 +153,8 @@ void CompleteAllOnDispose (Queue queue)

WaitCallback cb;
for (int i = 0; i < pending.Length; i++) {
SocketAsyncResult ares = (SocketAsyncResult) pending [i];
Worker worker = (Worker) pending [i];
SocketAsyncResult ares = worker.result;
cb = new WaitCallback (ares.CompleteDisposed);
ThreadPool.QueueUserWorkItem (cb, null);
}
Expand Down Expand Up @@ -338,7 +339,7 @@ public SocketError ErrorCode

private sealed class Worker
{
SocketAsyncResult result;
internal SocketAsyncResult result;

public Worker (SocketAsyncResult ares)
{
Expand Down

0 comments on commit d65f4ad

Please sign in to comment.