IWSClientProvider.cs 684 B

123456789101112131415161718192021
  1. using System;
  2. namespace IFramework.Net.WebSocket
  3. {
  4. public interface IWSClientProvider:IDisposable
  5. {
  6. bool IsConnected { get; }
  7. OnConnectedHandler OnConnected { get; set; }
  8. OnDisconnectedHandler OnDisconnected { get; set; }
  9. OnReceivedHandler OnReceived { get; set; }
  10. OnReceivedSegmentHandler OnReceivedBytes { get; set; }
  11. OnSentHandler OnSent { get; set; }
  12. bool Connect(string wsUrl);
  13. bool Connect(WSConnectionItem wsUrl);
  14. bool Send(SegmentOffset data, bool waiting = true);
  15. bool Send(string msg, bool waiting = true);
  16. void SendPing();
  17. void SendPong(SegmentOffset buf);
  18. }
  19. }