haxetink / tink_tcp

TCP everywhere!
MIT License
13 stars 6 forks source link

OpenFL/Lime blocked? #4

Open aW4KeNiNG opened 8 years ago

aW4KeNiNG commented 8 years ago

Hi!

In the first place, thanks for tink's libraries!

I have a problem when i use the Monsoon library. It works fine if i use as Haxe project, but if it is a OpenFL/Lime projects, it is blocked in the Server.hx L137.

I am using CPP & Windows.

Here a simple project to replicate the problem. Sometime, when i use Ctrl+C to close the app from the console, the GUI application is closed, but the Server is working fine now. It responses correctly.

How could i fix the problem?

Thanks in advance.

back2dos commented 8 years ago

I'm not sure how to go about this, since I'm not at all familiar with either of both projects (or even hxcpp), so it's a bit hard for me to debug. But I'll be meeting Hugh at the WWX in less than two weeks, so I hope I can get a hint how to go about this.

I think the solution will be to tie tink_runloop into the respective framework's runloop. You can see how it's done for JS and Flash: https://github.com/haxetink/tink_runloop/blob/master/src/tink/RunLoop.hx#L87 Maybe it could be equally simple for lime / OpenFL.