Exemplo n.º 1
0
        public Endpoint(Context context, SocketType socketType, string address)
        {            
            m_context = context;
            m_socketType = socketType;

            Uri uri = new Uri(address);

            if (uri.Scheme != "tcp" || !string.IsNullOrEmpty(uri.Fragment) || !string.IsNullOrEmpty(uri.Query))
                throw new ArgumentException("invalid address");

            m_hostName = uri.Host;
            m_port = uri.Port;

            m_handshake = new HandshakeStateMachine(m_context, m_hostName, m_port, m_socketType);
            m_receiveStateMachine = new ReceiveStateMachine(m_context);
            m_sendStateMachine = new SendStateMachine(m_context);
        }
Exemplo n.º 2
0
 public Socket(SocketType socketType)
 {
     SocketType = socketType;
     m_context = new Context();
 }