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

Author Topic: Non-blocking TCP connect cannot be completed  (Read 174 times)

0 Members and 1 Guest are viewing this topic.

tauzero

  • Newbie
  • *
  • Posts: 2
    • View Profile
Non-blocking TCP connect cannot be completed
« on: June 06, 2019, 04:13:24 pm »
The ability to complete a non-blocking TCP connection by the client as discussed in the forum topic:
https://en.sfml-dev.org/forums/index.php?topic=7118.0
no longer works in 2.5.x. Looking at the change to TcpSocket::connect() between 2.4.x and master at https://github.com/SFML/SFML/blob/master/src/SFML/Network/TcpSocket.cpp points to the added disconnect() at the start of connect() as the cause. I can't find a work-around (other than continue use of 2.4.x).

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32110
    • View Profile
    • SFML's website
    • Email
Re: Non-blocking TCP connect cannot be completed
« Reply #1 on: June 06, 2019, 08:25:13 pm »
Did you try with a minimal code to make sure it wasn't something else? Any message in the standard (error) output?
Laurent Gomila - SFML developer

tauzero

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Non-blocking TCP connect cannot be completed
« Reply #2 on: June 06, 2019, 09:52:55 pm »
No I did not.
Note that the subsequent calls to connect() were testing to see if the socket (m_socket) is in the connected state, and returning 'Done' if it is.
I traced the call chain as ... TcpSocket::connect() -> TcpSocket::disconnect() -> Socket::close() which on return insures the socket handle (m_socket) is set to priv::SocketImpl::invalidSocket().
Thus, TcpSocket::connect(), always begins the establishment of a new connection on a newly created socket (via Socket::create()).
« Last Edit: June 06, 2019, 09:56:02 pm by tauzero »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32110
    • View Profile
    • SFML's website
    • Email
Re: Non-blocking TCP connect cannot be completed
« Reply #3 on: June 06, 2019, 10:27:37 pm »
Quote
No I did not.
Please do! It might be a bug in SFML 2.5, but we'd better be sure before investigating time on it.
Laurent Gomila - SFML developer