File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -145,6 +145,8 @@ public virtual bool Start()
145145
146146 // Bind the acceptor socket to the IP endpoint
147147 _acceptorSocket . Bind ( Endpoint ) ;
148+ // Refresh the endpoint property based on the actual endpoint created
149+ Endpoint = ( IPEndPoint ) _acceptorSocket . LocalEndPoint ;
148150 // Start listen to the acceptor socket with the given accepting backlog size
149151 _acceptorSocket . Listen ( _acceptorBacklog ) ;
150152
Original file line number Diff line number Diff line change @@ -136,6 +136,8 @@ public virtual bool Start()
136136
137137 // Bind the acceptor socket to the IP endpoint
138138 _acceptorSocket . Bind ( Endpoint ) ;
139+ // Refresh the endpoint property based on the actual endpoint created
140+ Endpoint = ( IPEndPoint ) _acceptorSocket . LocalEndPoint ;
139141 // Start listen to the acceptor socket with the given accepting backlog size
140142 _acceptorSocket . Listen ( _acceptorBacklog ) ;
141143
Original file line number Diff line number Diff line change @@ -150,6 +150,8 @@ public virtual bool Start()
150150
151151 // Bind the server socket to the IP endpoint
152152 Socket . Bind ( Endpoint ) ;
153+ // Refresh the endpoint property based on the actual endpoint created
154+ Endpoint = ( IPEndPoint ) Socket . LocalEndPoint ;
153155
154156 // Prepare receive endpoint
155157 _receiveEndpoint = new IPEndPoint ( ( Endpoint . AddressFamily == AddressFamily . InterNetworkV6 ) ? IPAddress . IPv6Any : IPAddress . Any , 0 ) ;
You can’t perform that action at this time.
0 commit comments