Код: Выделить всё
// This line both checks the type AND declares RemoteEndPoint
if (AsyncResult.AsyncState is not EndPoint RemoteEndPoint)
throw new NotImplementedException("EndPoint is null");
// RemoteEndPoint is in scope here because the pattern match succeeded
var IncomingSize = ListenSocket.EndReceiveFrom(AsyncResult, ref RemoteEndPoint);
Спасибо!
Подробнее здесь: https://stackoverflow.com/questions/794 ... -in-c-shar