Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SystemTcpConnectionInformation.cs
Go to the documentation of this file.
2
4{
5 private readonly IPEndPoint _localEndPoint;
6
7 private readonly IPEndPoint _remoteEndPoint;
8
9 private readonly TcpState _state;
10
11 public override TcpState State => _state;
12
14
16
17 internal SystemTcpConnectionInformation(in global::Interop.IpHlpApi.MibTcpRow row)
18 {
19 _state = row.state;
20 int port = (row.localPort1 << 8) | row.localPort2;
21 int port2 = ((_state != TcpState.Listen) ? ((row.remotePort1 << 8) | row.remotePort2) : 0);
22 _localEndPoint = new IPEndPoint(row.localAddr, port);
23 _remoteEndPoint = new IPEndPoint(row.remoteAddr, port2);
24 }
25
26 internal SystemTcpConnectionInformation(in global::Interop.IpHlpApi.MibTcp6RowOwnerPid row)
27 {
28 _state = row.state;
29 int port = (row.localPort1 << 8) | row.localPort2;
30 int port2 = ((_state != TcpState.Listen) ? ((row.remotePort1 << 8) | row.remotePort2) : 0);
31 _localEndPoint = new IPEndPoint(new IPAddress(row.localAddrAsSpan, row.localScopeId), port);
32 _remoteEndPoint = new IPEndPoint(new IPAddress(row.remoteAddrAsSpan, row.remoteScopeId), port2);
33 }
34}
SystemTcpConnectionInformation(in global::Interop.IpHlpApi.MibTcp6RowOwnerPid row)