Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / Socket advantages?

Author
Message
Scribble
7
Years of Service
User Offline
Joined: 2nd Apr 2017
Location:
Posted: 12th Apr 2017 10:58
Hello everybody.
I'm new at multiplayer programming, but I've made some working multiplayer functions using AppGameKit multiplayer commands.

I've seen some 'socket' commands in the multiplayer command list.
I imagine it's some sort of lower level access for multiplayer?

Can you guys explain in a gist of what these 'sockets' are, and their advantages compared to normal multiplayer commands?
Would be beneficial to steer me in the right direction.
Thanks
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 14th Apr 2017 02:02
Sockets will work in HTML5, the other network commands do not. I'm not entirely sure how the multiplayer commands work, but sockets are a lot more versatile. You can custom build your packet and send it all at once. Whereas, as far as I can tell, the other commands send data as you write it rather than building up a buffer and flushing it out to the client.

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 15th Apr 2017 15:07 Edited at: 15th Apr 2017 15:07
Actually socket commands should be a higher abstraction than the Multilayer commands

Quote: "Whereas, as far as I can tell, the other commands send data as you write it rather than building up a buffer and flushing it out to the client"

YOU ARE building a packet and flushing it out like:

For the Multilayer commands you should manage the packet size by yourself but they can also differ from 1400 (max socket packet size)

The biggest difference for us is indeed sockets are working in HTML5 ^^

Using AGKv2 Tier1
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 15th Apr 2017 19:58
You can add a byte to a socket packet, the smallest amount you can add to a regular packet is a 4 byte integer. (I know there are strings where you could possible add one char, but that must at least require another byte for termination, so at least 2 bytes there).
13/0

Login to post a reply

Server time is: 2024-04-24 07:26:21
Your offset time is: 2024-04-24 07:26:21