Exemplo n.º 1
0
    public void ConnectToServer()
    {
        if (_networkSocket == null)
        {
            return;
        }

        if (_networkSocket.IsConnected)
        {
            return;
        }

        _networkSocket.Connect();
    }
Exemplo n.º 2
0
        public void Connect(IPAddress address, int port)
        {
            try
            {
                var ep   = new IPEndPoint(address, port);
                var hail = NetworkSocket.CreateMessage("unity-Client: request open connection");

                Log.Information("attempting connection to: {ep}", ep.ToString());

                NetworkSocket.Connect(ep, hail);
            }
            catch (System.Exception e)
            {
                Log.Error("Error: {e}", e.ToString());
            }
        }