wikiti / extension-networking

Library developed for OpenFL to facilitate connections between applications, using TCP sockets, and following the scheme of event-driven programming.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Websockets connecting to native server

Miltage opened this issue · comments

This is more of a question, rather than an issue.

I can get a client and server both running in neko to connect perfectly, but when I try to run a server in neko and the client in html5 I get the following errors:

Client side

WebSocket connection to 'ws://127.0.0.1:6066/' failed: WebSocket is closed before the connection is established.
NetworkTest.js:4106 NetworkLogger.hx:60: # NETWORK EVENT -- $ -- NETWORK_EVENT_INIT_SUCCESS -- {
	message : Connected to 127.0.0.1:6066
}
NetworkTest.js:4106 NetworkLogger.hx:60: # NETWORK EVENT -- $ -- NETWORK_EVENT_CONNECTED -- {
	message : Connected to 127.0.0.1:6066
}
NetworkTest.js:4106 NetworkLogger.hx:60: # NETWORK EVENT -- $ -- NETWORK_EVENT_MESSAGE_SENT -- {
	obj : 80F87D76-3DF5-C123-2AF8-929FDAACC195 ([object Socket]), 
	message : {
		metadata : {
			client : {
				active : true, 
				uuid : 80F87D76-3DF5-C123-2AF8-929FDAACC195
			}, 
			server : null
		}, 
		data : {
			verb : _core.sync.update_client_data, 
			uuid : 80F87D76-3DF5-C123-2AF8-929FDAACC195
		}
	}
}
NetworkTest.js:4106 NetworkLogger.hx:60: # NETWORK EVENT -- $ -- NETWORK_EVENT_DISCONNECTED -- {
	message : Connection lost: End of file was encountered
}
3NetworkTest.js:4106 NetworkLogger.hx:60: # NETWORK ERROR -- $ -- Socket is not initialized.

Server side

NetworkLogger.hx:60: # NETWORK EVENT -- $ -- NETWORK_EVENT_CONNECTED -- { server => { info => 63209B61-7032-9506-6198-475B2621274F (local), max_connections => 24, port => 6066, _session => [object Session], clients => [], _thread => { _on_start => null, _active => true, _mutex => { _mutex => { m => #abstract } }, _on_loop => #function:0, _on_stop => null }, ip => 0.0.0.0, _uuid => null, _mutex => { _mutex => { m => #abstract } } }, client => 8E0F0672-84FA-ECBC-574B-BA9F61C9B3D9 (127.0.0.1:52070) }
Main.hx:39: Connected
NetworkLogger.hx:60: # NETWORK ERROR -- $ -- Socket is not initialized.
NetworkLogger.hx:60: # NETWORK EVENT -- $ -- NETWORK_EVENT_DISCONNECTED -- { server => { info => 63209B61-7032-9506-6198-475B2621274F (local), max_connections => 24, port => 6066, _session => [object Session], clients => [], _thread => { _on_start => null, _active => true, _mutex => { _mutex => { m => #abstract } }, _on_loop => #function:0, _on_stop => null }, ip => 0.0.0.0, _uuid => null, _mutex => { _mutex => { m => #abstract } } }, client => 8E0F0672-84FA-ECBC-574B-BA9F61C9B3D9 (127.0.0.1:52070) }

Are connections from web sockets -> native sockets not supported?

Hello, Miltage!

Currently, they are not supported. I'll try to see if there are already some libraries to emulate sockets in javascripts clients (like HTML5). Otherwise, I should add a clarification on the README file.

Best regards,
Daniel

TODOS:

  • Document this issue on the future wiki.

Documented on Considerations wiki page. If you have more questions, please, feel free to re-open this issue.

Have a nice day!