Socket.Close()

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

    Socket.Close()

    hello, as i understand it in C# u pass a copy of the reference by default,
    no for my Example

    iv'e got 2 Forms witch in the first a Socket connects and then is being passed in the constractor to the other form

    now as i understand it they both have a reference to the same place in memory ,
    now in the second form i call Socket.Close()
    when the second form closes , the first form is up

    and the socket witch is used there was of course set to close, i want to detect that status of the socket
    something like if(Socket.Close d)

    this is because in some situations i Call Socket.Disconne ct(true) , and when errors occur i call Socket.Close()

    my questions are :
    1) how to detect if a socket is closed and not disconnected on The side it was closed on,
    (please try to understand that i could well of said a oledb connection,the socket is not
    the issue as much as detecting if a closeable object was closed)
    2) can the reference of the Socket object be set to null , then the other Socket would also reference null and that i could detect
Working...