Mercurial > hg > Database > Christie-sharp
comparison daemon/Connection.cs @ 33:7575980bffc9
update
author | riono <e165729@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 20 Apr 2021 18:42:17 +0900 |
parents | 0cd2684e401b |
children | 1236da135f79 |
comparison
equal
deleted
inserted
replaced
32:3a7a71ee8738 | 33:7575980bffc9 |
---|---|
27 /// <summary> | 27 /// <summary> |
28 /// socketが接続しているhostnameとそのport番号を返す | 28 /// socketが接続しているhostnameとそのport番号を返す |
29 /// </summary> | 29 /// </summary> |
30 /// <returns></returns> | 30 /// <returns></returns> |
31 public string GetInfoString() { | 31 public string GetInfoString() { |
32 return Dns.GetHostEntry(((IPEndPoint) socket.LocalEndPoint).Address.ToString()).HostName + ":" + | 32 IPEndPoint endPoint = (IPEndPoint) socket.RemoteEndPoint; |
33 ((IPEndPoint) socket.LocalEndPoint).Port; | 33 IPAddress ipAddress = endPoint.Address; |
34 IPHostEntry hostEntry = Dns.GetHostEntry(ipAddress); | |
35 // Dns.GetHostEntry(((IPEndPoint) socket.RemoteEndPoint).Address.ToString()).HostName + ":" +((IPEndPoint) socket.RemoteEndPoint).Port; | |
36 return hostEntry.HostName + ":" + endPoint.Port; | |
37 | |
34 } | 38 } |
35 | 39 |
36 /// <summary> | 40 /// <summary> |
37 /// socketを閉じる | 41 /// socketを閉じる |
38 /// </summary> | 42 /// </summary> |