/// <summary> /// Connects to server. /// </summary> public void Connect() { _communicationChannel = CreateCommunicationChannel(); _communicationChannel.Disconnected += CommunicationChannel_Disconnected; _communicationChannel.MessageReceived += CommunicationChannel_MessageReceived; _communicationChannel.MessageSent += CommunicationChannel_MessageSent; _communicationChannel.Start(); //_pingTimer.Start(); OnConnected(); }
/// <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(); }
/// <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(); }
/// <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 = Observable .Interval(TimeSpan.FromSeconds(30)) .Subscribe( x => { PingTimer_Elapsed(); }); OnConnected(); }