private void WaitForData() { using (socketSyncLock.Lock()) { #if NET45 socket.BeginReceive(socketBuffer, 0, BufferSize, SocketFlags.None, callback, null); #endif #if NETSTANDARD1_6 Receiver receiver = ReceiveData; receiver.BeginInvoke(socketBuffer, 0, BufferSize, SocketFlags.None, callback, null); #endif } }