System.Net.Sockets.Socket.SocketAsyncResult.GetDelegate C# (CSharp) Méthode

GetDelegate() private méthode

private GetDelegate ( Worker worker, SocketOperation op ) : SocketAsyncCall
worker Worker
op SocketOperation
Résultat SocketAsyncCall
			SocketAsyncCall GetDelegate (Worker worker, SocketOperation op)
			{
				switch (op) {
				case SocketOperation.ReceiveGeneric:
					goto case SocketOperation.Receive;
				case SocketOperation.Receive:
					return new SocketAsyncCall (worker.Receive);
				case SocketOperation.ReceiveFrom:
					return new SocketAsyncCall (worker.ReceiveFrom);
				case SocketOperation.SendGeneric:
					goto case SocketOperation.Send;
				case SocketOperation.Send:
					return new SocketAsyncCall (worker.Send);
				case SocketOperation.SendTo:
					return new SocketAsyncCall (worker.SendTo);
				default:
					return null; // never happens
				}
			}