void ReceiveResult(IAsyncResult ar) { var receiveCallback = (ReceiveDelegate)ar.AsyncState; IPEndPoint ep = null; var bytes = m_Client.EndReceive(ar, ref ep); if (this is NetworkServer) { (this as NetworkServer).addClient(ep); } receiveCallback(bytes, b => MessageTranslator.Interpret(ep, b)); }