ITcpClientProvider.cs 994 B

1234567891011121314151617181920212223242526
  1. using System;
  2. namespace IFramework.Net.Tcp
  3. {
  4. public interface ITcpClientProvider:IDisposable
  5. {
  6. ChannelProviderType ChannelProviderState { get; }
  7. int SendBufferPoolNumber { get; }
  8. bool IsConnected { get; }
  9. OnConnectedHandler ConnectedCallback { get; set; }
  10. OnDisconnectedHandler DisconnectedCallback { get; set; }
  11. OnReceivedSegmentHandler ReceivedOffsetCallback { get; set; }
  12. OnReceivedHandler RecievedCallback { get; set; }
  13. OnSentHandler SentCallback { get; set; }
  14. void Connect(int port, string ip);
  15. bool ConnectSync(int port, string ip);
  16. bool ConnectTo(int port, string ip);
  17. void Disconnect();
  18. void ReceiveSync(SegmentOffset receiveSegment, Action<SegmentOffset> receivedAction);
  19. bool Send(SegmentOffset sendSegment, bool waiting = true);
  20. //void SendFile(string filename);
  21. int SendSync(SegmentOffset sendSegment, SegmentOffset receiveSegment);
  22. }
  23. }