Inheritance: global::Java.Lang.Object, global::Java.Lang.ICloneable, global::Java.Nio.Channels.IByteChannel, global::Square.OkIO.IBufferedSink, global::Square.OkIO.IBufferedSource
Ejemplo n.º 1
0
 void IWebSocketListener.OnPong(OkBuffer buffer)
 {
     var handler = Pong;
     if (handler != null)
     {
         handler(sender, new PongEventArgs(buffer));
     }
 }
Ejemplo n.º 2
0
        private void StartMessages(IWebSocket webSocket)
        {
            // we want to ping every 2 seconds
            new Timer(state =>
            {
                var buffer = new OkBuffer();
                buffer.WriteString("Ping!", Charset.DefaultCharset());
                webSocket.SendPing(buffer);
            }, null, TimeSpan.Zero, TimeSpan.FromSeconds(2));

            // we want to send a message every 5 seconds
            new Timer(state =>
            {
				var body = RequestBody.Create(WebSocket.Text, "Hello World!");
                webSocket.SendMessage(body);
            }, null, TimeSpan.Zero, TimeSpan.FromSeconds(3));
        }
Ejemplo n.º 3
0
 void IWebSocketListener.OnPong(OkBuffer buffer)
 {
     var handler = Pong;
     if (handler != null)
     {
         handler(buffer);
     }
 }