New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NetRender doesn't connect with localhost #258

Closed
buddhi1980 opened this Issue Feb 26, 2017 · 5 comments

Comments

Projects
None yet
4 participants
@buddhi1980
Owner

buddhi1980 commented Feb 26, 2017

System information (version)
  • mandelbulber2 => 2.10
  • Operating System / Platform => All
  • Compiler => gcc, mingw
Detailed description

When client is on the same machine as server then there is generated connection error

Warning: QAbstractSocket::connectToHost() called when already looking up or connecting/connected to "localhost" (:0

Similar error was reported here: http://www.fractalforums.com/bug-reporting-b231/version-2-10-clients-crashing/new/?topicseen#new

Steps to reproduce

start NetRender server and client on the same machine and try connect them together.

zebastian added a commit that referenced this issue Feb 27, 2017

netrender reconnection fix
this fixes reconnects while lookup of host, related to: #258
@zebastian

This comment has been minimized.

Show comment
Hide comment
@zebastian

zebastian Feb 27, 2017

Collaborator

i found a problem, which probably caused this behaviour:

The client tries to reconnect to the server, as long as it is not in the state QAbstractSocket::ConnectedState.
see: void CNetRender::TryServerConnect()

If the client is already trying to connect to the server, it should do nothing (since the establishing of the connection may take longer than 1 second). If it is not already connecting, it should reset the socket and start a connection, which effectively should only be run once at the beginning, or while the server is unreachable.

The problem is: client recognized only the "ConnectingState" as the pending state, but there is also a HostLookupState which also resolves to an "establishing connection state"
If this takes too long (even on localhost i could reprodouce this) the socket gets resetted every second before it can finish the lookup, hence the error log.

Adding HostLookupState as a "wait for result" state seems to fix the problem, see commit: b8eb297

Collaborator

zebastian commented Feb 27, 2017

i found a problem, which probably caused this behaviour:

The client tries to reconnect to the server, as long as it is not in the state QAbstractSocket::ConnectedState.
see: void CNetRender::TryServerConnect()

If the client is already trying to connect to the server, it should do nothing (since the establishing of the connection may take longer than 1 second). If it is not already connecting, it should reset the socket and start a connection, which effectively should only be run once at the beginning, or while the server is unreachable.

The problem is: client recognized only the "ConnectingState" as the pending state, but there is also a HostLookupState which also resolves to an "establishing connection state"
If this takes too long (even on localhost i could reprodouce this) the socket gets resetted every second before it can finish the lookup, hence the error log.

Adding HostLookupState as a "wait for result" state seems to fix the problem, see commit: b8eb297

@buddhi1980

This comment has been minimized.

Show comment
Hide comment
@buddhi1980

buddhi1980 Feb 27, 2017

Owner

Works perfect! Thanks!

Owner

buddhi1980 commented Feb 27, 2017

Works perfect! Thanks!

@buddhi1980 buddhi1980 closed this Feb 27, 2017

@CCV54

This comment has been minimized.

Show comment
Hide comment
@CCV54

CCV54 Mar 2, 2017

Yep, thanks zebastian! Fixed my problem, as mentioned by buddhi1980 - http://www.fractalforums.com/bug-reporting-b231/version-2-10-clients-crashing/ - and a little more.

CCV54 commented Mar 2, 2017

Yep, thanks zebastian! Fixed my problem, as mentioned by buddhi1980 - http://www.fractalforums.com/bug-reporting-b231/version-2-10-clients-crashing/ - and a little more.

@mclarekin

This comment has been minimized.

Show comment
Hide comment
@mclarekin

mclarekin Mar 2, 2017

Collaborator
Collaborator

mclarekin commented Mar 2, 2017

@buddhi1980

This comment has been minimized.

Show comment
Hide comment
@buddhi1980

buddhi1980 Mar 2, 2017

Owner

gamepad messages under Windows come from different versions of QtGamepad (5.8) and QtCore (5.7).

Owner

buddhi1980 commented Mar 2, 2017

gamepad messages under Windows come from different versions of QtGamepad (5.8) and QtCore (5.7).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment