internal SocketHandler GetSocket()
{
if (_socketCount == 0)
return null;
lock (this)
{
if (_socketList != null)
{
SocketHandler socket = _socketList.Handler;
_socketList = _socketList.Next;
bool bRes = socket.RaceForControl();
// We should always have control since there shouldn't
// be contention here.
InternalRemotingServices.RemotingAssert(bRes, "someone else has the socket?");
_socketCount--;
return socket;
}
}
return null;
} // GetSocket