haxetink / tink_tcp

TCP everywhere!
MIT License
13 stars 6 forks source link

Socket.select and null params #6

Closed dfadev closed 8 years ago

dfadev commented 8 years ago

For the cpp target Socket.select maps to _hx_std_socket_select in Socket.cpp. This function expects non-null parameters however tink_tcp passes nulls in two calls to Socket.select in Connection.hx.

back2dos commented 8 years ago

Yeah, this is generally a little horrible right now. There should be an actual selection in place. Would passing [] solve your particular issue?

dfadev commented 8 years ago

Passing empty arrays solves my issue. Otherwise I get a Null Object Reference exception.

I would have thought nulls should work too, but not a big deal. The weird effect was the socket still worked as long as I slept a little between stepping the RunLoop. Maybe the GC got a chance to run and somehow that hid the error.