// When data is sent to the conncted host.
 protected virtual void OnConnectionSend(State state)
 {
     ConnectionSend?.Invoke(this, new SocketReceiveEventArgs()
     {
         ReceiveState = state
     });
 }
Exemple #2
0
        public int Send(string message)
        {
            ConnectionSend.WriteLine(message);
            ConnectionSend.Flush();

            return(0);
        }
Exemple #3
0
        public int Disconnect()
        {
            ConnectionStatus = 4;

            try
            {
                ConnectionReceive.Close();
                ConnectionSend.Close();
                ConnectionSocket.Close();
                ConnectionStatus = 0;
            }
            catch (Exception e)
            {
                ConnectionStatus = 2;
            }

            return(0);
        }