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

            return(0);
        }
Ejemplo n.º 3
0
        public int Disconnect()
        {
            ConnectionStatus = 4;

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

            return(0);
        }