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.

Raspberry Pi / POSSIBLE BUG: When joining network running on RPi, app in RPi crashes sometimes

Author
Message
Cybermind
14
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Searching for The Dark Tower
Posted: 17th Dec 2016 10:39 Edited at: 22nd Dec 2016 11:59
Hello I have a small server app (Tier 1) that runs on a Raspberry Pi with Raspbian OS. Sometimes, when connecting to the server app on the RPi, it just exits, no errors, no nothing, just gone. I have attached some code, the first part has to run on RPi, and the second part I ran on a Windows 10 machine. Remember to set your preferred port on host and client and the right IP in the client app.

EDIT: This has been a long standing issue for me. I think this error has been there from the very beginning of AGK2 for RPi.

EDIT 2: I updated the code a little for convenience when setting IP and port. The bug occurs when connecting to the host app running on RPi, the app just closes after a few logins. The client code just logs on and off, to producde the bug on RPi.

RPi code:
+ Code Snippet

Client code:
+ Code Snippet
13/0
Cybermind
14
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Searching for The Dark Tower
Posted: 16th Jan 2017 11:33
Are there any news on this bug? Can somebody confirm this bug?
13/0
Jack
12
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 27th Jan 2017 23:33
+ Code Snippet

The reason is, that JoinNetwork has some kind of delay before connecting. I think its explained in the Guide refering CreateNetwork/ JoinNetwork.
Create a while loop at the mentioned point until there are at least 2 clients in the network.
(at least two clients means 1x client, 1x server = connected)

Greetings, Jack

[/url]
Cybermind
14
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Searching for The Dark Tower
Posted: 28th Jan 2017 14:50
It is the host app running on Raspberry Pi that closes. I can login/JoinNetwork a few times before the app just closes. The joining client is run on a Windows machine.
13/0
Jack
12
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 28th Jan 2017 15:38 Edited at: 28th Jan 2017 15:50
Use the same idea on the server.
https://www.appgamekit.com/documentation/Reference/Multiplayer/GetNetworkNumClients.htm

Something like:
+ Code Snippet
I also got a PI/Droid network running like you want.
I did some benchmark on this System - client connected / client lost / server lost / server connected / commands from the server / commands to the server
- It performed well for over 48h, then I stopped the test.
Some templates that have to work:


Server template:

+ Code Snippet


Client template:
+ Code Snippet

[/url]
Cybermind
14
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Searching for The Dark Tower
Posted: 28th Jan 2017 16:25
Thanks a million times Jack Your code runs fine I will work on it from here
13/0
Cybermind
14
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Searching for The Dark Tower
Posted: 28th Jan 2017 16:46
I think it is the DeleteNetworkClient() that I was missing. Removing that makes the app crash, both yours and mine.
13/0
Jack
12
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 30th Jan 2017 01:31
I am glad I could help.
It's good to hear, that it helped you to get your code running.

[/url]

Login to post a reply

Server time is: 2017-08-19 21:30:12
Your offset time is: 2017-08-19 21:30:12