public override SocketTasks StartClient()
        {
            var socketTask = SocketTask.Working;

            m_ServerHostId       = RelayTransport.AddHost(new HostTopology(GetConfig(), 1), false);
            m_ServerConnectionId = RelayTransport.Connect(m_ServerHostId, ConnectAddress, ConnectPort, 0, out byte error);

            var connectError = (NetworkError)error;

            switch (connectError)
            {
            case NetworkError.Ok:
                socketTask.Success       = true;
                socketTask.TransportCode = error;
                socketTask.SocketError   = System.Net.Sockets.SocketError.Success;
                socketTask.IsDone        = false;

                // We want to continue to wait for the successful connect
                m_ConnectTask = socketTask;
                break;

            default:
                socketTask.Success       = false;
                socketTask.TransportCode = error;
                socketTask.SocketError   = System.Net.Sockets.SocketError.SocketError;
                socketTask.IsDone        = true;
                break;
            }

            return(socketTask.AsTasks());
        }
Example #2
0
        public int Connect(string address, int port, object settings, bool websocket, out byte error)
        {
            NetworkTransport.Init();
            int hostId = RelayTransport.AddHost((HostTopology)settings, false);

            return(RelayTransport.Connect(hostId, address, port, 0, out error));
        }
Example #3
0
        public override void StartClient()
        {
            UpdateRelay();

            serverHostId = RelayTransport.AddHost(new HostTopology(GetConfig(), 1), false);

            serverConnectionId = RelayTransport.Connect(serverHostId, ConnectAddress, ConnectPort, 0, out byte error);
        }
Example #4
0
 public void Connect(string address, int port, object settings, out byte error)
 {
     serverHostId       = RelayTransport.AddHost(new HostTopology((ConnectionConfig)settings, 1), false);
     serverConnectionId = RelayTransport.Connect(serverHostId, address, port, 0, out error);
 }