Skip to content
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

Listening to socket fails when exporting to HTML5 #8897

Closed
JonasPf opened this issue May 24, 2017 · 5 comments
Closed

Listening to socket fails when exporting to HTML5 #8897

JonasPf opened this issue May 24, 2017 · 5 comments

Comments

@JonasPf
Copy link

JonasPf commented May 24, 2017

Operating system or device - Godot version:

Ubuntu 16.04 with Godot 2.1.3.stable.official

Issue description:

My godot project listens to a socket using this code:

var port = 4545
var server = TCP_Server.new()

func _ready():
	if server.listen(port) == 0:
		print("Server running on port " + str(port))
		set_process(true)
	else:
		print("Cannot listen on port " + str(port))
		get_tree().quit()

I export it to HTML5 and run it locally using the python internal webserver: sudo python -m SimpleHTTPServer. When I open the webpage, it starts loading and fails with the following message:

**WARNING**: At: ./drivers/unix/socket_helpers.h:87:_socket_create() - Unable to set/unset IPv4 address mapping over IPv6
bad ioctl syscall 21537
abort("bad ioctl syscall 21537") at Error
    at jsStackTrace (http://127.0.0.1:8000/index.js:1:17538)
    at stackTrace (http://127.0.0.1:8000/index.js:1:17709)
    at abort (http://127.0.0.1:8000/index.js:3:12282)
    at ___syscall54 (http://127.0.0.1:8000/index.js:1:174652)
    at qoj (http://127.0.0.1:8000/index.asm.js:27:104858)
    at Array.CRa (http://127.0.0.1:8000/index.asm.js:18:126238)
    at Array.cRi (http://127.0.0.1:8000/index.asm.js:14:809595)
    at Array.MHh (http://127.0.0.1:8000/index.asm.js:16:643720)
    at p4i (http://127.0.0.1:8000/index.asm.js:14:1161263)
    at UA (http://127.0.0.1:8000/index.asm.js:23:909097)
If this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.
**EXCEPTION**:
@vnen
Copy link
Member

vnen commented May 24, 2017

AFAIK networking was never implemented for the HTML5 platform.

@leonkrause
Copy link
Contributor

That's right, in fact this can't be implemented, direct TCP is impossible in browsers.
However I want to get HTTPClient working in time for 3.0, maybe we'll also add support for WebSocket or WebRTC eventually

@JonasPf
Copy link
Author

JonasPf commented May 24, 2017

Ok cool, thanks for all the great work :-)

@leonkrause
Copy link
Contributor

We have #4226 open for HTTPClient, so closing this

@vnen
Copy link
Member

vnen commented May 24, 2017

@eska014 BTW, apparently Emscripten is capable of proxying UDP packets over WebSockets: https://twitter.com/icculus/status/860379737658621952

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

No branches or pull requests

3 participants