Added the TcpListener::Close function
git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1585 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
parent
16d986c762
commit
61dc7e0100
3 changed files with 30 additions and 6 deletions
|
@ -79,6 +79,17 @@ public :
|
|||
////////////////////////////////////////////////////////////
|
||||
Status Listen(unsigned short port);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Stop listening and close the socket
|
||||
///
|
||||
/// This function gracefully stops the listener. If the
|
||||
/// socket is not listening, this function has no effect.
|
||||
///
|
||||
/// \see Listen
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
void Close();
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Accept a new connection
|
||||
///
|
||||
|
@ -110,16 +121,21 @@ public :
|
|||
/// a given port and waits for connections on that port.
|
||||
/// This is all it can do.
|
||||
///
|
||||
/// When a new connection is received, the socket returns a
|
||||
/// new instance of sf::TcpSocket that is properly
|
||||
/// initialized and can be used to communicate with the
|
||||
/// new client.
|
||||
/// When a new connection is received, you must call Accept and
|
||||
/// the listener returns a new instance of sf::TcpSocket that
|
||||
/// is properly initialized and can be used to communicate with
|
||||
/// the new client.
|
||||
///
|
||||
/// Listener sockets are specific to the TCP protocol,
|
||||
/// UDP sockets are connectionless and can therefore communicate
|
||||
/// directly. As a consequence, a listener socket will always
|
||||
/// return the new connections as sf::TcpSocket instances.
|
||||
///
|
||||
///
|
||||
/// A listener is automatically closed on destruction, like all
|
||||
/// other types of socket. However if you want to stop listening
|
||||
/// before the socket is destroyed, you can call its Close()
|
||||
/// function.
|
||||
///
|
||||
/// Usage example:
|
||||
/// \code
|
||||
/// // Create a listener socket and make it wait for new
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue