IChannel.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System;
  2. using System.Net;
  3. namespace Vinno.IUS.Common.Network.Channels
  4. {
  5. public interface IChannel
  6. {
  7. /// <summary>
  8. /// Gets the ChannelId for this Channel;
  9. /// </summary>
  10. int Id { get; }
  11. /// <summary>
  12. /// Gets the Remote host info, for Server, this property means client, for client, this property
  13. /// means server.
  14. /// </summary>
  15. IPEndPoint Remote { get; set; }
  16. /// <summary>
  17. /// Gets the Local host info, for Server, this property means server, for client, this property
  18. /// means client.
  19. /// </summary>
  20. IPEndPoint Local { get; set; }
  21. /// <summary>
  22. /// Raised when channel was closed.
  23. /// </summary>
  24. event EventHandler Closed;
  25. /// <summary>
  26. /// Update the channel's Id.
  27. /// </summary>
  28. /// <param name="channelId"></param>
  29. void UpdateChannelId(int channelId);
  30. /// <summary>
  31. /// Close the channel, and raise the event of close.
  32. /// </summary>
  33. void Close();
  34. }
  35. }