Web Sockets

Posted By: Feindbild

Web Sockets - 11/26/13 20:57

Would it be possible to communicate with an Acknex server via HTML5 Websockets? Maybe using the Anet plugin?
I have to admit I have no experience whatsoever in GStudio multiplayer coding, so I'd be glad to hear about any advice and information from you guys.
Posted By: Quad

Re: Web Sockets - 11/26/13 21:41

Anet plugin won't speak websockets. But i am pretty sure it can be done with a plugin.
Posted By: Feindbild

Re: Web Sockets - 11/28/13 14:43

There are several C/C++ websockets libraries existing, but I have no idea how to integrate them into Acknex. I guess I'd need to create something called a "wrapper" since I can't just use the DLLs, right?

Is there a tutorial available on how to achieve what I want to do or at least something that puts me in the right direction?
Posted By: Quad

Re: Web Sockets - 11/28/13 16:22

check out the sdk_plugin folder in yout Gstudio folder
Posted By: WretchedSid

Re: Web Sockets - 11/28/13 17:40

You can alternatively use LoadLibrary() and GetProcAddress() to load the library at runtime and get addresses out of it. Just include the right header and bind the correction functions and you are done.
Posted By: Feindbild

Re: Web Sockets - 11/30/13 16:22

From what I gathered from the manual (thanks Sid for pointing me in the right direction!) I can use the Windows API directly from within Lite-C, right?
Does this mean I could use these protocols:
http://msdn.microsoft.com/en-us/library/windows/desktop/hh437448(v=vs.85).aspx
just by including the right functions?

edit: disregard that, it seems this component is only available in Windows 8
Posted By: MasterQ32

Re: Web Sockets - 11/30/13 19:37

you could implement the websocket protocol with tcp communication and sockets.
a web socket is afaik just a socket connection that builds its connection via a http header.
Posted By: WretchedSid

Re: Web Sockets - 11/30/13 19:45

Originally Posted By: MasterQ32
a web socket is afaik just a socket connection that builds its connection via a http header.

It really is a tiny bit more complicated than that.

Also, various incompatible versions of the protocol.
Posted By: MasterQ32

Re: Web Sockets - 11/30/13 21:09

only a little grin
maybe there's another c library for that
Posted By: Feindbild

Re: Web Sockets - 12/06/13 18:05

http://libwebsockets.org/trac/libwebsockets

Pure C Websocket library, this seems to do the trick... now I only need to find the time to work myself into it laugh
Posted By: Feindbild

Re: Web Sockets - 12/23/13 23:08

After working... ehm, playing with this for nearly two weeks now, I realized I have no idea what I am doing. Directly integrating this into Lite-C seems to be impossible (at least for me), I can't even get it to compile because of syntax errors.
So, what alternatives do I have? Basically my goal is to get realtime input from a mobile phone into Acknex, I guess websockets would be the only way to go.

Does anyone have a better idea? Or at least a different? Or is somehow able to get this to work for me? frown
Posted By: Ch40zzC0d3r

Re: Web Sockets - 12/23/13 23:18

Well is php an option for you?
Simply use the browser of your phone and use php and a sql databse?
Or is is a way too slow for you?
Posted By: oliver2s

Re: Web Sockets - 12/24/13 01:24

I've done something like this. Wrote an android app that sends UDP data real time to 3DGS. But this was only in local home network. I've done this with socket_... instructions, but I really don't know how to extend this to work also over Internet.
Posted By: Feindbild

Re: Web Sockets - 12/24/13 13:27

I want to use the browser, that's why I need those websockets smirk simple GET would be too slow because of the effing huge overhead. I don't need perfect precision, bout a latency of <=200ms would be superb.
Coding an app and doing stuff via UDP would be another possibility, though I don't really want to further complicate the project itself... Would be cool if you could share your code though, oliver! laugh
Posted By: Feindbild

Re: Web Sockets - 12/24/13 18:04

I made it!
The solution is ANet's TCP Server functionality combined with the websockify wrapper!!!
Posted By: Quad

Re: Web Sockets - 12/24/13 19:25

But it's like layering a layer over a layer that is already layering another layer.
Posted By: Feindbild

Re: Web Sockets - 12/24/13 20:59

Originally Posted By: Quad
But it's like layering a layer over a layer that is already layering another layer.


yeah, but it works grin
I already see why this is not a perfect solution... but it works, man! let me be happy grin
© 2024 lite-C Forums