public Client(string username) { this.username = username; this.fiber = new PoolFiber(); this.fiber.Start(); this.peerListener = new PeerListener(username, this.OnConnectCallback); this.peer = new PhotonPeer(this.peerListener, Settings.UseTcp ? ConnectionProtocol.Tcp : ConnectionProtocol.Udp); this.connectResetEvent = new AutoResetEvent(false); }
public Client(string username) { this.username = username; this.fiber = new PoolFiber(); this.fiber.Start(); this.peerListener = new PeerListener(username, this.OnConnectCallback); this.peer = new PhotonPeer(this.peerListener, Settings.UseTcp ? ConnectionProtocol.Tcp : ConnectionProtocol.Udp); this.connectResetEvent = new AutoResetEvent(false); }
/// <summary> /// Initializes a new instance of the <see cref="Client"/> class. /// </summary> /// <param name="username"> /// The username. /// </param> public Client(string username) { this.username = username; this.fiber = new PoolFiber(); this.fiber.Start(); this.peerListener = new PeerListener(username, this.OnConnectCallback); this.peer = new PhotonPeer(this.peerListener, Settings.UseTcp) { ChannelCount = 3 }; this.connectResetEvent = new AutoResetEvent(false); }
public static void ResetStats() { Interlocked.Exchange(ref exceptions, 0); Interlocked.Exchange(ref eventsReceivedSent, 0); Interlocked.Exchange(ref eventReceiveTimeFast, 0); Interlocked.Exchange(ref eventReceiveTimeMiddle, 0); Interlocked.Exchange(ref eventReceiveTimeSlow, 0); Interlocked.Exchange(ref eventReceiveTimeMax, 0); Interlocked.Exchange(ref eventsReceivedFast, 0); Interlocked.Exchange(ref eventsReceivedMiddle, 0); Interlocked.Exchange(ref eventsReceivedSlow, 0); Interlocked.Exchange(ref operationsSent, 0); PeerListener.ResetStats(); }
private void OnConnectCallback(PeerListener obj, bool success) { this.connected = success; this.connectResetEvent.Set(); }
/// <summary> /// Initializes a new instance of the <see cref="Client"/> class. /// </summary> /// <param name="username"> /// The username. /// </param> public Client(string username) { this.username = username; this.fiber = new PoolFiber(); this.fiber.Start(); this.peerListener = new PeerListener(username, this.OnConnectCallback); this.peer = new PhotonPeer(this.peerListener, Settings.UseTcp) { ChannelCount = 3 }; this.connectResetEvent = new AutoResetEvent(false); }
private void OnConnectCallback(PeerListener obj, bool success) { this.connected = success; this.connectResetEvent.Set(); }