public void Connect(bool isRemote) { UriBuilder builder; if (isRemote) { builder = new UriBuilder() { Scheme = "wss", Host = "tylrpage.com", Port = Constants.GAME_PORT }; } else { builder = new UriBuilder() { Scheme = "ws", Host = "localhost", Port = Constants.GAME_PORT }; } Debug.Log("Connecting to " + builder.Uri); _ws.Connect(builder.Uri); }
public void Connect() { // connect UriBuilder uriBuilder = new UriBuilder() { Scheme = "wss", Host = "tylrpage.com", Port = Constants.GAME_PORT }; _webClient.Connect(uriBuilder.Uri); }
private void Connect() { var tcpConfig = new TcpConfig(true, 5000, 5000); client = SimpleWebClient.Create(32000, 500, tcpConfig); client.onConnect += () => Debug.Log($"Connected to Server"); client.onDisconnect += () => Debug.Log($"Disconnected from Server"); client.onData += OnData; client.onError += (exception) => Debug.Log($"Error because of Server, Error:{exception}"); client.Connect(new Uri("ws://localhost:7776")); }