Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Does the TCP disconnect() trigger selector wait()?  (Read 1977 times)

0 Members and 1 Guest are viewing this topic.

Cube777

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
Does the TCP disconnect() trigger selector wait()?
« on: January 11, 2015, 04:00:03 pm »
Hello, I'm using the socket selector class to monitor a bunch of TCP sockets, and I was wondering if I called disconnect() on any of the sockets, will it trigger the wait() function of the selector? Or is this only when receive() is ready? (Documentation didn't mention anything on disconnect()). Also , does the destructor of the TCP socket call disconnect()? Thanks in advance for any help!

Gambit

  • Sr. Member
  • ****
  • Posts: 283
    • View Profile
Re: Does the TCP disconnect() trigger selector wait()?
« Reply #1 on: January 12, 2015, 04:37:22 am »
Yes. When a socket disconnects, when you receive data from that socket, the status should be sf::Socket::Status::Disconnected or whatever it is.

 

anything