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.

Author
Message
CodeName
7
Years of Service
User Offline
Joined: 30th Dec 2016
Location:
Posted: 25th Jan 2017 10:21 Edited at: 25th Jan 2017 13:10
:: I cant get two devices to work together. They connect, everything works fine, then after a few sec disconnect.
:: If I connect to my PC then to any device it works, and vice versa.
everything is up to date.. even AGK2 player on all devices.

Thanks for your time.


CodeName
7
Years of Service
User Offline
Joined: 30th Dec 2016
Location:
Posted: 26th Jan 2017 10:36
Found the problem.. Read about Networks having restrictions on lower value Port Numbers(1029) [due to hackers hacking lower port Numbers], So I raised the port value to 48230 as in the AGK2 Help example and Got Er Done!

[Do not use lower port Values!! Networks may restrict them!!]
CodeName
7
Years of Service
User Offline
Joined: 30th Dec 2016
Location:
Posted: 26th Jan 2017 11:40
Nope back to not working, sounded like the best solution but No Go. Worked for a good amount of time then stopped.

But am thinking it must be my Network setup for Ubuntu. Something... Its all new to me... This Networking.
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 26th Jan 2017 19:05 Edited at: 26th Jan 2017 19:07
Are there periods in which no traffic is being sent?

Are both sides sending and receiving or is one side only sending and one side only receiving?

A sender only may be disconnecting after a while if it never gets anything back from the other side, or if no traffic is passed for a bit (20-30 seconds).

If you are not regularly sending game data both ways, you may try sending a regular (5-10 seconds) 'keep alive' packet (didn't need to contain anything much, just be sent and received) both ways and see if the connection is maintained
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
CodeName
7
Years of Service
User Offline
Joined: 30th Dec 2016
Location:
Posted: 26th Jan 2017 23:35
Will work on what you said, that sounds most likely be the problem.

The host is what is crashing, and all its doing is receiving.

Thanks bud.

CodeName
7
Years of Service
User Offline
Joined: 30th Dec 2016
Location:
Posted: 27th Jan 2017 03:43
Will work on what you said, that sounds most likely be the problem.

The host is what is crashing, and all its doing is receiving.

Thanks bud.

CodeName
7
Years of Service
User Offline
Joined: 30th Dec 2016
Location:
Posted: 27th Jan 2017 07:04
Mod

Bud = buddy in American English.

I'm just wondering why I cant see my post..

Take Care

CodeName
7
Years of Service
User Offline
Joined: 30th Dec 2016
Location:
Posted: 27th Jan 2017 07:04
Mod

Bud = buddy in American English.

I'm just wondering why I cant see my post..

Take Care

Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 27th Jan 2017 15:45
If you are a newish user without many posts, you are likely still on manual post approval
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
CodeName
7
Years of Service
User Offline
Joined: 30th Dec 2016
Location:
Posted: 31st Jan 2017 00:00
I sent a random number back as I was receiving, same problem.

Data is being sent back and forth. I'll have to later test, on a different secondary device.

For now I'll just start on testing the IP options.

Thanks for your help, Ortu.

Carharttguy
7
Years of Service
User Offline
Joined: 8th Jul 2016
Location: Belgium
Posted: 31st Jan 2017 15:08
Can you show some of your networking code?
TCP should handle stay alive packets, so that should be no concern.

Are you sending a lot of data at a high bitrate? Eg: Putting network code in your main loop? You might DOS'ing yourself?

CodeName
7
Years of Service
User Offline
Joined: 30th Dec 2016
Location:
Posted: 7th Feb 2017 01:50 Edited at: 7th Feb 2017 01:50
No commands to set the latency, the latency command is only for the local network.. right?

I put the code on the first post.

I exported the app and installed on to both devices and same problem, host will disconnect from network after like 5 sec..

I'm trying the Socket commands and cant even get those working.. cant test using my computer, it's connected to the Internet with IPv6. and AppGameKit doesn't support IPv6.
CodeName
7
Years of Service
User Offline
Joined: 30th Dec 2016
Location:
Posted: 7th Feb 2017 02:20 Edited at: 7th Feb 2017 02:21
https://forum.thegamecreators.com/thread/199001#m2378774

Found this.. deep breath.. life, is not over..
CodeName
7
Years of Service
User Offline
Joined: 30th Dec 2016
Location:
Posted: 7th Feb 2017 11:20
"Putting network code in your main loop? You might DOS'ing yourself"

So are you saying I cant put CreateSocketListener() or any other network connecting code in my main loop? Because I am doing that.

I'm using a Select command and those such socket commands and local network commands are in a Case in the main loop.. That part of the code for the connecting is never executed again though.

Ill try later today, to put that code out of the main loop, must sleep.

Thanks Carharttguy.. I hope I'm understanding you right. Take Care
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 7th Feb 2017 16:40
It's fine like that if it is only called the once, you might add logging to verify that it is really only called once.

I think he was talking more about sending packets in the main loop potentially causing too many packets to be sent too quickly. It would be hard to cause a DOS I think with just one client and one server running at 30-60 fps though
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
CodeName
7
Years of Service
User Offline
Joined: 30th Dec 2016
Location:
Posted: 7th Feb 2017 21:32 Edited at: 7th Feb 2017 21:35
Ok thanks Ortu, two questions, to establish a connection would I have to send data, and do I use my device's (not local wifi 192..) 3g local IP, or public IP?

AGK has two commands. CreateSocketListener() and ConnectSocket().. what I don't understand is both commands are used to deal with transferring data...

AGK2 only has like three connecting Socket commands, it should take a second to explain everything.

I used the example in the help folder and now I can make a local network, one that doesn't work when its device to device, but computer to device.
I'm ok with that, I don't plan on using a local network anytime soon. And am looking to use another device to test with and go from there to ride myself of the problem.

Om sill just going to have to do a hell of allot more research... research is fun, I learn more haha

Thanks all.
BuccaneerBob
AGK Developer
13
Years of Service
User Offline
Joined: 18th Aug 2010
Location: Canada
Posted: 7th Feb 2017 23:09 Edited at: 7th Feb 2017 23:13
If you're trying to connect 2 devices using AppGameKit, don't bother using CreateSocket() or CreateSocketListener(). Using AGK's in-house multiplayer platform by doing HostNetwork() and JoinNetwork() and then if the connection between 2 AppGameKit devices is established you can do GetNetworkMessage () to handle data back and forth. This will still work over internet and multiple devices, you will need to create a function to call the hosting devices IP address and make sure any client's are connecting to the proper devices. But it does work over the internet, I've done it several times, the only unfortunate thing about AGK's CreateNetwork() and JoinNetwork() features are that there's no way to delete a socket once a person has disconnected, so it's not great if you plan to have a several devices connected at once, or anything that is persistant allowing people to drop in or drop out and reuse identifiers. That's where you'd want to use CreateSocket() and CreateSocketLIstener() and create an actual server application in VB, C# etc etc. The CreateSocket() and CreateSocketListener() is great for connecting AppGameKit to say something using Winsock or something else, but for connection between 2 AppGameKit devices, just use their own networking platform it saves a ton of hassle.
Robert Janes (Samu Games)
http://www.samugames.com/artifact
CodeName
7
Years of Service
User Offline
Joined: 30th Dec 2016
Location:
Posted: 8th Feb 2017 01:32
Thanks SamuGames I will be looking over the code you sent me..

One thing to note, I have IPv6, so I cant test anything.

But I may be able to test the code on a network that supports IPv4.

Thanks again.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 8th Feb 2017 01:50
I would love to see an example of that code too.
Quell Dieu
7
Years of Service
User Offline
Joined: 8th Feb 2017
Playing: Genres: Action, MOBA, FPS, Fighting, TBS, RTS, Puzzle.
Posted: 10th Mar 2017 13:51
hope i wont get this problem XD

could you post it here if you fixed it and what problem is the cause

Login to post a reply

Server time is: 2024-04-23 21:04:32
Your offset time is: 2024-04-23 21:04:32