Ejemplo n.º 1
0
        private void Initialize(SocketIOClient.Scheme Scheme, string Host, int Port, bool JsonOnly, bool AutoReconnect, bool UseAckTimeout)
        {
            string URIString = string.Format("{0}://{1}:{2}/socket.io/?EIO=4&transport=websocket", Scheme, Host, Port);

            this.Client = new WebSocket(URIString);

            this.Client.OnOpen    += OnWebsocketOpen;
            this.Client.OnClose   += OnWebsocketClose;
            this.Client.OnMessage += OnWebsocketMessage;
            this.Client.OnError   += OnWebsocketError;

            this.ConnectionInformation.Scheme = Scheme;
            this.ConnectionInformation.Host   = Host;
            this.ConnectionInformation.Port   = Port;

            this.JsonOnly      = JsonOnly;
            this.AutoReconnect = AutoReconnect;
            this.UseAckTimeout = UseAckTimeout;
        }
Ejemplo n.º 2
0
 public SocketIOClient(SocketIOClient.Scheme Scheme, string Host, int Port, bool JsonOnly = false, bool AutoReconnect = false, bool UseAckTimeout = false)
 {
     Initialize(Scheme, Host, Port, JsonOnly, AutoReconnect, UseAckTimeout);
 }