Closed GoogleCodeExporter closed 9 years ago
I don't understand the issue. A reference in a lookup (say, a Dictionary<>) is
equally sized no matter what the size of the class referenced.
Nevertheless, a GetConnection(IPEndPoint) could be useful for applications -
I've made it public in rev 155.
Original comment by lidg...@gmail.com
on 23 Nov 2010 at 9:56
Thanks
What i was referring to is that applications might want to relate their own
data properties against a connection. In that situation, the application will
have to hold on to a reference to the connection, such that the connection can
be obtained for send purposes. The netconnection is rather large in comparison
with the object IPEndPoint which would result in holding a duplicate set of
NetConnections in memory.
Original comment by mark.js...@googlemail.com
on 23 Nov 2010 at 10:05
Since NetConnection is a class; holding a reference to it will not create any
duplicate data, the only extra memory will be the size of the pointer.
IPEndPoint on the other hand is a struct, ie. value type, so you cannot hold a
reference to it - only a copy.
Original comment by lidg...@gmail.com
on 23 Nov 2010 at 10:15
Original issue reported on code.google.com by
mark.js...@googlemail.com
on 23 Nov 2010 at 7:07