Beispiel #1
0
 /// <summary>
 /// Connects to the provided endpoint
 /// </summary>
 /// <param name="ep">The endpoint to connect to</param>
 public void Connect(IPEndPoint ep)
 {
     try
     {
         MapleSocket.Connect(ep);
     }
     catch (SocketException sEx)
     {
         //TODO: Handle exception
     }
 }
Beispiel #2
0
        /// <summary>
        /// Connects to the provided IP address and port
        /// </summary>
        /// <param name="ip">The IP address to connect to</param>
        /// <param name="port">The port on the IP address to connect to</param>
        public void Connect(string ip, ushort port)
        {
            IPAddress ipAddress;

            if (!IPAddress.TryParse(ip, out ipAddress))
            {
                throw new NetworkingException("The provided IP address cannot be parsed.", 1001);
            }

            try
            {
                MapleSocket.Connect(ipAddress, port);
            }
            catch (SocketException sEx)
            {
                //TODO: Handle exception
            }
        }