Outils pour utilisateurs

Outils du site


lang:csharp:web

Ceci est une ancienne révision du document !


WebSocket

Connecting to websocket using C# (I can connect using JavaScript, but C# gives Status code 200 error) - Stack Overflow, Archive

Librairie websocket-sharp, Archive du 28 juin 2017

La librairie est compatible Windows XP avec le Framework 4.

using System;
using WebSocketSharp;
 
namespace Example
{
  public class Program
  {
    public static void Main (string[] args)
    {
      using (var ws = new WebSocket ("ws://dragonsnest.far/Laputa")) {
        ws.OnMessage += (sender, e) =>
          Console.WriteLine ("Laputa says: " + e.Data);
 
        ws.Connect ();
        ws.Send ("BALUS");
        Console.ReadKey (true);
      }
    }
  }
}
lang/csharp/web.1505045967.txt.gz · Dernière modification : 2017/09/10 14:19 de root