public ConnectionManager(ClientEngine engine)
{
this.engine = engine;
this.endCheckEncryptionCallback = ClientEngine.MainLoop.Wrap(EndCheckEncryption);
this.endSendMessageCallback = (a, b, c) => ClientEngine.MainLoop.Queue(() => EndSendMessage(a, b, c));
this.endCreateConnectionCallback = (a, b, c) => ClientEngine.MainLoop.Queue (() => EndCreateConnection (a, b, c));
this.incomingConnectionAcceptedCallback = (a, b, c) => ClientEngine.MainLoop.Queue (() => IncomingConnectionAccepted(a, b, c));
this.handshakeSentCallback = PeerHandshakeSent;
this.peerHandshakeReceivedCallback = (a, b, c) => ClientEngine.MainLoop.Queue (() => PeerHandshakeReceived (a, b, c));
this.messageSentCallback = PeerMessageSent;
this.messageReceivedCallback = (a, b, c) => ClientEngine.MainLoop.Queue (() => MessageReceived (a, b, c));
this.pendingConnects = new List<AsyncConnectState>();
}