You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
660 B

  1. using Apewer;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Net.Sockets;
  5. using System.Text;
  6. namespace Apewer.Network
  7. {
  8. /// <summary></summary>
  9. public struct SocketEndPoint
  10. {
  11. internal SocketEndPoint(Socket socket, string ip, int port)
  12. {
  13. Socket = socket;
  14. IP = ip ?? TextUtility.EmptyString;
  15. Port = NumberUtility.RestrictValue(port, 0, ushort.MaxValue);
  16. }
  17. /// <summary></summary>
  18. public Socket Socket { get; }
  19. /// <summary></summary>
  20. public string IP { get; }
  21. /// <summary></summary>
  22. public int Port { get; }
  23. }
  24. }