public bool ConnectTo(string ip, int port)
        {
            isDead_ = false;
            try
            {
                Connect(ip, port);
            }
            catch (SocketException exp)
            {
                isDead_ = true;
            }
            var netAddr = new NetworkAdderss(ip, port);

            endpoint_ = new IPEndPoint(netAddr.IP, netAddr.Port);
            AsyncListen();
            return(!isDead_);
        }
 public bool Connect(NetworkAdderss srvrAddr)
 {
     try
     {
         if (!srvrAddr.IsIpValid() || !srvrAddr.IsPortValid())
         {
             return(false);
         }
         if (ConnectAsync(srvrAddr.IP.ToString(), srvrAddr.Port).Wait(100))
         {
             isDead_       = false;
             serverStream_ = GetStream();
             AsyncListen();
         }
     }
     catch (SocketException exp)
     {
         //wrong address
         isDead_ = true;
     }
     return(!isDead_);
 }