Networking.Client.Client C# (CSharp) Method

Client() public method

Creates a new instance
public Client ( string address, int port ) : System
address string The address to connect to
port int The port to use for the connection
return System
        public Client(string address, int port)
        {
            try {
                IPHostEntry hostInfo = Dns.GetHostByName(address);
                _endpoint = new IPEndPoint(hostInfo.AddressList[0], port);
                _socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
                _running = false;
                _thread = new Thread(new ThreadStart(Work));
            }catch(Exception e) {

            }
        }