// When data is sent to the conncted host. protected virtual void OnConnectionSend(State state) { ConnectionSend?.Invoke(this, new SocketReceiveEventArgs() { ReceiveState = state }); }
public int Send(string message) { ConnectionSend.WriteLine(message); ConnectionSend.Flush(); return(0); }
public int Disconnect() { ConnectionStatus = 4; try { ConnectionReceive.Close(); ConnectionSend.Close(); ConnectionSocket.Close(); ConnectionStatus = 0; } catch (Exception e) { ConnectionStatus = 2; } return(0); }