News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

Bug? Network mode not working on Intel Mac nightly

Started by Ashley, December 31, 2010, 12:01:24 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ashley

Hello,

Just been trying to test networked mode and have figured out that it appears not to work on the latest Intel mac nightly builds. I tried r4114, r4105 and r4082.

The logs show very little, and increasing the debug level doesn't seem to show a lot more. Here's the server log from 4082:

Message: network_command_t::rdwr: write packet_id=7, client_id=0
Message: karte_t::interactive_event(): Keyboard event with code 0 '?'
Message: check_activity(): Accepted connection from: 127.0.0.1.

Message: socket_list_t::add_client: add client socket[10]
Message: network_command_t::rdwr: read packet_id=1, client_id=0
Warning: network_check_activity(): received cmd id=1 nwc_gameinfo_t from socket[10]
Message: nwc_gameinfo_t::execute:
Message: network_command_t::rdwr: write packet_id=1, client_id=0
Message: packet_t::send: sent 20 bytes to socket[10]; id=1, size=20, left=-20
Message: packet_t::send: sent 20 bytes to socket[10]; id=1, size=20
Message: socket_list_t::remove_client: remove client socket[10]
Message: network_command_t::rdwr: write packet_id=7, client_id=0


And the client log for the same connection attempt:

Warning: network_connect: Server did not respond!

The client was run with command line:

./sim-macintel -log 1 -debug 2

The server with:

./sim-macintel -log 1 -debug 3 -server 13353 -lang en

Then I tried to connect to the server 127.0.0.1. Everything is vanilla pak64, with a config file only slightly modified to set it to be a single-user install (it does exactly the same thing with the default config file too).

I cannot connect to any server on the internet either, same error. Seems like client or server just gives up at some point during the connection. I don't have a firewall running on this machine, and there shouldn't be anything in between me and the servers on the Internet either.

The exact same config/files running on Windows works perfectly (using the windows binary obviously) so I deduce that this is some issue with the Intel mac build.

Any suggestions for further steps I can take to give more information to help fix this problem would be appreciated :)
Use Firefox? Interested in IPv6? Try SixOrNot the IPv6 status indicator for Firefox.
Why not try playing Simutrans online? See the Game Servers board for details.

Dwachs

You can try to connect to your local server by typing 'net:localhost' in the 'load savegame' dialog. Maybe this helps?

Please start the client with '-debug 3' too.

At least the server received something from the client, but the reply to the client was lost.
Parsley, sage, rosemary, and maggikraut.

prissi

Try to enter IPv6 addresses, those may result in a different behaviour.

However, it may very well be that the mac-support is broken, i.e. lookup of addresses to get the socket fails. Please compile it on the mac and check again. If this works, then there is a problem in the crosscompiler.

Ashley

With debug 3, on the client. First trying to connect to ::1 and then trying to connect to 127.0.0.1

Message: gui_scrolled_list_t::show_selection(): sel=0, offset=0, groesse.y=70
Message: gui_scrolled_list_t::show_selection(): sel=0, offset=0, groesse.y=70
Message: gui_combobox_t::infowin_event(): close
Warning: network_connect: Bad address :
Message: karte_t::interactive_event(): Keyboard event with code 0 '?'
Message: karte_t::interactive_event(): Keyboard event with code 0 '?'
Message: karte_t::interactive_event(): Keyboard event with code 0 '?'
Message: karte_t::interactive_event(): Keyboard event with code 0 '?'
Message: event: 87,5
Message: event: 87,5
Message: event: 87,5
Message: event: 87,5
Message: event: 87,5
Message: event: 87,5
Message: event: 87,5
Message: event: 87,5
Message: event: 87,5
Message: event: 87,5
Message: event: 87,5
Message: event: 87,5
Message: event: 109,4
Message: gui_scrolled_list_t::show_selection(): sel=0, offset=0, groesse.y=70
Message: gui_scrolled_list_t::show_selection(): sel=0, offset=0, groesse.y=70
Message: gui_combobox_t::infowin_event(): close
Message: network_command_t::rdwr: write packet_id=1, client_id=0
Message: packet_t::send: sent 20 bytes to socket[7]; id=1, size=20, left=-20
Message: packet_t::send: sent 20 bytes to socket[7]; id=1, size=20
Message: socket_list_t::add_client: add client socket[7]
Warning: network_connect: Server did not respond!
Message: karte_t::interactive_event(): Keyboard event with c


And on the server:

Message: karte_t::reset_timer(): called, mode=$1
Message: karte_t::reset_timer(): called, mode=$1
Message: karte_t::reset_timer(): called, mode=$4
Running world, pause=0, fast forward=0 ...
Message: karte_t::reset_timer(): called, mode=$4
Message: karte_t::reset_timer(): called, mode=$4
Message: karte_t::interactive_event(): Keyboard event with code 0 '?'
Message: network_command_t::rdwr: write packet_id=7, client_id=0
Message: network_command_t::rdwr: write packet_id=7, client_id=0
Message: network_command_t::rdwr: write packet_id=7, client_id=0
Message: network_command_t::rdwr: write packet_id=7, client_id=0
Message: network_command_t::rdwr: write packet_id=7, client_id=0
Message: network_command_t::rdwr: write packet_id=7, client_id=0
Message: check_activity(): Accepted connection from: 127.0.0.1.

Message: socket_list_t::add_client: add client socket[10]
Message: network_command_t::rdwr: read packet_id=1, client_id=0
Warning: network_check_activity(): received cmd id=1 nwc_gameinfo_t from socket[10]
Message: nwc_gameinfo_t::execute:
Message: network_command_t::rdwr: write packet_id=1, client_id=0
Message: packet_t::send: sent 20 bytes to socket[10]; id=1, size=20, left=-20
Message: packet_t::send: sent 20 bytes to socket[10]; id=1, size=20
Message: socket_list_t::remove_client: remove client socket[10]
Message: network_command_t::rdwr: write packet_id=7, client_id=0
Message: network_command_t::rdwr: write packet_id=7, client_id=0
Message: network_command_t::rdwr: write packet_id=7, client_id=0
Message: network_command_t::rdwr: write packet_id=7, client_id=0
Message: network_command_t::rdwr: write packet_id=7, client_id=0
Message: network_command_t::rdwr: write packet_id=7, client_id=0
Message: network_command_t::rdwr: write packet_id=7, client_id=0
Message: network_command_t::rdwr: write packet_id=7, client_id=0
Message: network_command_t::rdwr: write packet_id=7, client_id=0
Message: network_command_t::rdwr: write packet_id=7, client_id=0
Message: network_command_t::rdwr: write packet_id=7, client_id=0
Message: network_command_t::rdwr: write packet_id=7, client_id=0
Message: network_command_t::rdwr: write packet_id=7, client_id=0
Message: network_command_t::rdwr: write packet_id=7, client_id=0
Message: network_command_t::rdwr: write packet_id=7, client_id=0
Message: network_command_t::rdwr: write packet_id=7, client_id=0
Message: network_command_t::rdwr: write packet_id=7, client_id=0
Message: network_command_t::rdwr: write packet_id=7, client_id=0
Message: network_command_t::rdwr: write packet_id=7, client_id=0
Message: network_command_t::rdwr: write packet_id=7, client_id=0
Message: check_activity(): Accepted connection from: 127.0.0.1.

Message: socket_list_t::add_client: add client socket[10]
Message: network_command_t::rdwr: read packet_id=1, client_id=0
Warning: network_check_activity(): received cmd id=1 nwc_gameinfo_t from socket[10]
Message: nwc_gameinfo_t::execute:
Message: network_command_t::rdwr: write packet_id=1, client_id=0
Message: packet_t::send: sent 20 bytes to socket[10]; id=1, size=20, left=-20
Message: packet_t::send: sent 20 bytes to socket[10]; id=1, size=20
Message: socket_list_t::remove_client: remove client socket[10]
Message: network_command_t::rdwr: write packet_id=7, client_id=0
Message: network_command_t::rdwr: write packet_id=7, client_id=0



When I try using net:localhost in the load save game dialog (from the server):

Message: check_activity(): Accepted connection from: 127.0.0.1.

Message: socket_list_t::add_client: add client socket[10]
Message: network_command_t::rdwr: read packet_id=1, client_id=0
Warning: network_check_activity(): received cmd id=1 nwc_gameinfo_t from socket[10]
Message: nwc_gameinfo_t::execute:
Message: network_command_t::rdwr: write packet_id=1, client_id=0
Message: packet_t::send: sent 20 bytes to socket[10]; id=1, size=20, left=-20
Message: packet_t::send: sent 20 bytes to socket[10]; id=1, size=20
Message: socket_list_t::remove_client: remove client socket[10]
Message: network_command_t::rdwr: write packet_id=7, client_id=0
Message: network_command_t::rdwr: write packet_id=7, client_id=0
Message: network_command_t::rdwr: write packet_id=7, client_id=0
Message: network_command_t::rdwr: write packet_id=7, client_id=0
Message: check_activity(): Accepted connection from: 0.0.0.0.

Message: socket_list_t::add_client: add client socket[10]
Message: network_command_t::rdwr: read packet_id=1, client_id=0
Warning: network_check_activity(): received cmd id=1 nwc_gameinfo_t from socket[10]
Message: nwc_gameinfo_t::execute:
Message: network_command_t::rdwr: write packet_id=1, client_id=0
Message: packet_t::send: sent 20 bytes to socket[10]; id=1, size=20, left=-20
Message: packet_t::send: sent 20 bytes to socket[10]; id=1, size=20
Message: socket_list_t::remove_client: remove client socket[10]
Message: network_command_t::rdwr: write packet_id=7, client_id=0
Message: check_activity(): Accepted connection from: 0.0.0.0.

Message: socket_list_t::add_client: add client socket[10]
Message: network_command_t::rdwr: read packet_id=2, client_id=0
Warning: network_check_activity(): received cmd id=2 nwc_join_t from socket[10]
Message: nwc_join_t::execute:
Message: network_command_t::rdwr: write packet_id=2, client_id=0
Message: packet_t::send: sent 21 bytes to socket[10]; id=2, size=21, left=-21
Message: packet_t::send: sent 21 bytes to socket[10]; id=2, size=21
Message: network_command_t::rdwr: write packet_id=3, client_id=0
Warning: network_world_command_t::execute: do_command 3 at sync_step 8142 world now at 8141
Warning: network_receive_data: error 54 while receiving from [10]
Message: socket_list_t::remove_client: remove client socket[10]
Warning: nwc_sync_t::do_command: sync_steps 8142
Message: karte_t::speichern(): saving game to 'server-network.sve'
Message: karte_t::speichern(loadsave_t *file): start
Message: karte_t::speichern(loadsave_t *file): saved cities ok
Message: karte_t::speichern(loadsave_t *file): saved tiles
Message: karte_t::speichern(loadsave_t *file): saved fabs
Message: karte_t::speichern(loadsave_t *file): saved stops
Message: karte_t::speichern(loadsave_t *file): saved 0 convois
Message: karte_t::speichern(loadsave_t *file): saved players
Message: karte_t::speichern(loadsave_t *file): saved messages
Warning: nwc_sync_t::do_command: send game failed with: Client closed connection during transfer
Message: karte_t::laden: loading game from 'server-network.sve'
Message: karte_t::laden(): Savegame version is 102005
Message: karte_t::destroy(): destroying world
Message: karte_t::destroy(): label clear
Message: karte_t::destroy(): convois destroyed
Message: haltestelle_t::set_name(): name Oil Rig already used!
Message: haltestelle_t::set_name(): name Oil Rig already used!


I will try compiling it myself on the mac and see if that is the issue.

Thanks :)
Use Firefox? Interested in IPv6? Try SixOrNot the IPv6 status indicator for Firefox.
Why not try playing Simutrans online? See the Game Servers board for details.

prissi

Previous reports was, that the serverlist actually is downloaded sucessful. Is this true?

Ashley

Yes, it does display the server list, but trying to connect to any of them gives the same message, that it cannot connect to the server. It seems to know that the server is up though since it's a different message to just connecting to a random IP address.
Use Firefox? Interested in IPv6? Try SixOrNot the IPv6 status indicator for Firefox.
Why not try playing Simutrans online? See the Game Servers board for details.

prissi

This looks very much like MacOS blocking certain ports, as the download routine for the servrlist is very similar to the one for the gameinfo request (at least in 38xx or so). Does it works, when the server runs on a lower part i.e. starting a server with "-server 81" or so?

Ashley

Tried it on port 81, made no difference I'm afraid.
Use Firefox? Interested in IPv6? Try SixOrNot the IPv6 status indicator for Firefox.
Why not try playing Simutrans online? See the Game Servers board for details.

Dwachs

Quote
When I try using net:localhost in the load save game dialog (from the server):
What says the log file of the client in this case? It seems odd that the server can receive and send, while the client never receives anything.
Parsley, sage, rosemary, and maggikraut.

prissi

The only difference is, that network_download_http(...) does not call network_check_activity() while all other calls to network use network_check_activity(). Thus no command could be recieved, while the recieving of files worked well. (Also the server relies on network_check_activity(); thus if this not works, nothing will be sent.)

Is USE_IP4_ONLY or TCP_NODELAY set for MACOS? Then it could be some problems with non-blocking sockets. Or one needs some other default parameters for select.

What is the datatype of SOCKET on MACOS?

prissi


Ashley

Testing with r4139, still not working, logs attached for client and server.

Thanks!
Use Firefox? Interested in IPv6? Try SixOrNot the IPv6 status indicator for Firefox.
Why not try playing Simutrans online? See the Game Servers board for details.

prissi

#12
Some further tests with my SLOW old powerMac emulator: While sending gives no error the server never recieves something.

In the log the socket for the gameinfo is always the same number than for the http, while for a new http request the socket number is increased. Any ideas?

EDIT: Further tests reveal that the timeout value is the problem. Removing this by setting it to NULL let me connect to a random server.

Ashley

I still haven't even gotten it to compile on my mac yet. Does the latest nightly include this change?
Use Firefox? Interested in IPv6? Try SixOrNot the IPv6 status indicator for Firefox.
Why not try playing Simutrans online? See the Game Servers board for details.

Dwachs

Parsley, sage, rosemary, and maggikraut.

prissi

German forum said lots of hanging computer, but some progress. Tonight I try non-blocking sokcets on my emulator. If thy work, I will commit fix.

Ashley

Yes lots of hanging, but it seems to work. The server seems to hang just after loading the map when restarting it, but initiating a client join or sending it a ctrl+c makes it finish loading (in the latter case it then shuts down).

The client can download game detail, and once I even got it to join the server (though this was in one case where I hit ctrl+c, the client joined then the server shut down. Doesn't seem to work otherwise).

It seems there's some kind of issue that happens right at the end of map loading maybe?

It's really strange how sending it repeated ctrl+c keystrokes in the console seems to cause it to un-hang for a while, but then eventually quit...

Logs attached for client and server though :)
Use Firefox? Interested in IPv6? Try SixOrNot the IPv6 status indicator for Firefox.
Why not try playing Simutrans online? See the Game Servers board for details.

prissi

You can sent any signal to the application, ctrl+Q and Cntrl+S (pause/unpause) would do it, since slect hang without timeout until a signal or network activity is recieved.

I am still working on it; but since any comiplation run takes 2h on a small PowerPC emulator, progress is slow.

Ashley

If it would help Prissi I could give you remote access to our mac mini, it's not the most modern machine but would likely be quicker than an emulator for compilation.
Use Firefox? Interested in IPv6? Try SixOrNot the IPv6 status indicator for Firefox.
Why not try playing Simutrans online? See the Game Servers board for details.

prissi

The emulator now just did sucessfully run a network game to the host (in 64x64 size with -fps 5 ... ) Maybe MAC support will work with todays (4170) nightly.

Ashley

That latest version does appear to work Prissi, thanks. I've attached logs again in case you want to check them.
Use Firefox? Interested in IPv6? Try SixOrNot the IPv6 status indicator for Firefox.
Why not try playing Simutrans online? See the Game Servers board for details.