How and why to reuse socket with Socket.Disconnect( )?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • eran otzar
    New Member
    • Jan 2011
    • 13

    How and why to reuse socket with Socket.Disconnect( )?

    Socket.Disconne ct(bool reuse) according to msdn enables the program to reuse the socket
    my questions are:

    1)
    if we decide to reuse the socket does that mean it will reuse the same local end point as well,what i'm asking is,
    would it preserve the port for that socket or would it just(i don't believe it does)
    save all the objects resources ?

    2)if in effect it does only save the resources would they be allocated to the next connection and if so do the send/receive buffers automaticly flush or is there some way the flush them ,
    does Socket.ShutDown (ShutDown.Both) do that for me on disconnect ?

    3) in what situation would i use Socket.Disconne ct(false) , if the all purpose is to reuse the socket what would this grant me ?
Working...