public Connection(Socket socket, DisconnectEventHandler disconnectHandler, int bufferSize = Globals.DefaultBufferSize, int sendInterval = Globals.DefaultSendInterval) { this.socket = socket; BufferSize = bufferSize; SendInterval = sendInterval; OnDisconnected += disconnectHandler; Name = socket.RemoteEndPoint.ToString(); threadReceive = new Thread(ThreadReceive) { IsBackground = true }; threadReceive.Start(); }
private void pop_Disconnected(object sender, string Server) { if (this.statusStrip.InvokeRequired) { DisconnectEventHandler discon = new DisconnectEventHandler(this.pop_Disconnected); this.Invoke(discon, new object[] { sender, Server }); } else { this.ProgressLabel.Text = "Disconnected with the pop server \"" + Server + "\""; Thread.Sleep(500); this.Send.Enabled = true; this.ProgressLabel.Text = "Email Client"; } }
private void pop_Disconnected(object sender, string Server) { if (this.statusStrip.InvokeRequired) { DisconnectEventHandler discon = new DisconnectEventHandler(this.pop_Disconnected); this.Invoke(discon, new object[] { sender, Server }); } else { this.ProgressLabel.Text = "Disconnected with the pop server \"" + Server + "\""; Thread.Sleep(500); this.Send.Enabled = true; this.ProgressLabel.Text = "Email Client"; } }
/// <summary> /// Add a disconnect handler to the OnDisconnect event /// </summary> public static void AddOnDisconnect(this IConnection connection, DisconnectEventHandler handler) { connection.OnDisconnect += handler; }
public static Task <Stinto> CreateAsync(string room, ConnectEventHandler OnConnect, DisconnectEventHandler OnDisconnect) { var server = new Stinto(OnConnect, OnDisconnect); return(server.InitializeAsync(room)); }
public static Task <Stinto> CreateAsync(Func <string, Task> RoomCreated, ConnectEventHandler OnConnect, DisconnectEventHandler OnDisconnect) { var server = new Stinto(OnConnect, OnDisconnect); return(server.InitializeAsync(RoomCreated)); }
public Stinto(ConnectEventHandler OnConnect, DisconnectEventHandler OnDisconnect) { this.OnConnect += OnConnect; this.OnDisconnect += OnDisconnect; }