I'm writing a network application and needed to know a little bit more about TcpSocket::disconnect() for sfml 2.0.
From the documentation we have:
Disconnect the socket from its remote peer.
This function gracefully closes the connection. If the socket is not connected, this function has no effect.
|
I wanted to know what exactly was going on under the hood here. I tried tracking it down in the source code but got stuck at SocketImpl::close(SocketHandle sock).
Specifically, does this function tell the socket's remote peer that this socket is disconnecting? Should I have to manually use the disconnect function on the remote peer's bound socket? (For example, application
A has tcpSocket
a bound to tcpSocket
b residing in application
B, if
a uses .disconnect(), does
b know this without me needing to send a packet of my own before disconnecting? Will this update
b automatically?)