Beispiel #1
0
 /// <summary>
 /// Connects to server.
 /// </summary>
 public void Connect()
 {
     WireProtocol.Reset();
     _communicationChannel = CreateCommunicationChannel();
     _communicationChannel.WireProtocol     = WireProtocol;
     _communicationChannel.Disconnected    += CommunicationChannel_Disconnected;
     _communicationChannel.MessageReceived += CommunicationChannel_MessageReceived;
     _communicationChannel.MessageSent     += CommunicationChannel_MessageSent;
     _communicationChannel.Start();
     //_pingTimer.Start();
     OnConnected();
 }
Beispiel #2
0
 /// <summary>
 /// Connects to server.
 /// </summary>
 public void Connect(params Tuple <SocketOptionLevel, SocketOptionName, object>[] socketOptions)
 {
     WireProtocol.Reset();
     _communicationChannel = CreateCommunicationChannel(socketOptions);
     _communicationChannel.WireProtocol     = WireProtocol;
     _communicationChannel.Disconnected    += CommunicationChannel_Disconnected;
     _communicationChannel.MessageReceived += CommunicationChannel_MessageReceived;
     _communicationChannel.MessageSent     += CommunicationChannel_MessageSent;
     _communicationChannel.Start();
     _pingTimer.Start();
     OnConnected();
 }