ServerStateEventArgs.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using DotNetty.Transport.Channels;
  2. using System;
  3. using System.Text;
  4. using Team.Communicate.Data;
  5. namespace Team.Communicate.EventArg
  6. {
  7. public class TcpStateEventArgs : EventArgs
  8. {
  9. public TcpConnection ServerConnection { get; }
  10. public TcpStateEventArgs(TcpConnection serverConnection)
  11. {
  12. ServerConnection = serverConnection;
  13. }
  14. }
  15. public class UnRegisterEventArgs : EventArgs
  16. {
  17. public UnRegisterContent ServerConnection { get; }
  18. public UnRegisterEventArgs(UnRegisterContent serverConnection)
  19. {
  20. ServerConnection = serverConnection;
  21. }
  22. }
  23. public record UnRegisterContent
  24. {
  25. public string Content { get; }
  26. public Encoding Encoding { get; set; }
  27. public IChannelHandlerContext ChannelHandlerContext { get; }
  28. public UnRegisterContent(string content, IChannelHandlerContext channelHandlerContext,Encoding encoding)
  29. => (Content, ChannelHandlerContext,Encoding) = (content, channelHandlerContext, encoding);
  30. public void Deconstruct(out string content, out IChannelHandlerContext channelHandlerContext,out Encoding encoding)
  31. => (content, channelHandlerContext,encoding) = (Content, ChannelHandlerContext,Encoding);
  32. }
  33. }