lnobad / lidgren-network-gen3

Automatically exported from code.google.com/p/lidgren-network-gen3
0 stars 0 forks source link

AcceptIncomingConnections not used #150

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Construct 2 NetPeers with configuration set such that 
AcceptIncomingConnections is false
2. The two peers can still connect to each other

What is the expected output? What do you see instead?
Using a config with AcceptIncomingConnections set to false you should not be 
able to connect to the NetPeer

What version of the product are you using? On what operating system?
r338 on Windows 7 64-bit

Please provide any additional information below.

It doesn't appear that the AcceptIncomingConnections property is actually used 
anywhere in the code. It looks like it should probably be checked somewhere in 
ReceivedUnconnectedLibraryMessage (NetPeer.Internal.cs) but I'm not sure at 
what point in the connection process this should occur.

Original issue reported on code.google.com by ja...@flit.com.au on 7 May 2013 at 6:04

GoogleCodeExporter commented 9 years ago
Looking into this further I think another option might be just to skip calling 
m_socket.Bind(ep) on line 121 of NetPeer.Internal.cs if 
AcceptIncomingConnections is set to to false.

Original comment by ja...@flit.com.au on 7 May 2013 at 6:47

GoogleCodeExporter commented 9 years ago
Oi! You are completely correct; fixed in rev 339.

Original comment by lidg...@gmail.com on 7 May 2013 at 7:38

GoogleCodeExporter commented 9 years ago
Thanks for the quick fix!

Original comment by ja...@flit.com.au on 7 May 2013 at 8:25