Ejemplo n.º 1
0
        public bool Negotiate()
        {
            DataBuffer init = new DataBuffer();

            init.InsertByte(4);
            init.InsertByte(1);
            byte[] port = BitConverter.GetBytes(m_profile.Gateway.ServerPort);
            init.InsertByte(port[1]);
            init.InsertByte(port[0]);
            init.InsertByteArray(m_con.ResolveEndPoint(m_profile.Gateway.ServerHost, m_profile.Gateway.ServerPort).Address.GetAddressBytes());
            init.InsertCString("*****@*****.**");

            m_con.Send(init.UnderlyingBuffer, 0, init.Count);

            byte[] result = new byte[8];
            result = m_con.Receive(result, 0, 8);
            return(result[1] == 0x5a);
        }
 public IPEndPoint ResolveEndPoint(string host, int port)
 {
     return(m_con.ResolveEndPoint(host, port));
 }