public SocketIOResponse(IList <JsonElement> array, SocketIO socket)
 {
     _array        = array;
     InComingBytes = new List <byte[]>();
     SocketIO      = socket;
     PacketId      = -1;
 }
Ejemplo n.º 2
0
        public SocketIoWrapper(string target)
        {
            _uri                 = target;
            _client              = new SocketIOClient.SocketIO(new Uri($"ws://{_uri}:31000/"));
            _client.OnConnected += OnConnected;

            _client.OnDisconnected += OnDisconnected;
            _client.On("progress", data => {
                var value = data.GetValue <FileCopyInfo>();
                OnFileCopyInfoHandlerEvent(new FileCopyInfoArgs(value));
            });
            _client.On("install", data =>
            {
                var value = data.GetValue <ProgressIndicator>();
                ShowToast("Locuste Launcher", value.Message);
                OnProgressUpdateEvent(new ProgressIndicatorArgs(value));
            });
            _client.On("update", data =>
            {
                var value = data.GetValue <AppVersion>();
                ShowToast("Locuste Launcher", $"Mise à jour de {value.Name} (v{value.Version})");
                OnUpdateHandlerEvent(new AppVersionEventArgs(value));
            });
        }
Ejemplo n.º 3
0
 public async Task CallbackAsync(params object[] data)
 {
     await SocketIO.EmitCallbackAsync(PacketId, data);
 }
 public async Task CallbackAsync(CancellationToken cancellationToken, params object[] data)
 {
     await SocketIO.ClientAckAsync(PacketId, cancellationToken, data).ConfigureAwait(false);
 }
Ejemplo n.º 5
0
 public SocketIOResponse(JArray array, SocketIO socket)
 {
     _array        = array;
     InComingBytes = new List <byte[]>();
     SocketIO      = socket;
 }