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.

AppGameKit Classic Chat / testing network functions

Author
Message
roujesky
20
Years of Service
User Offline
Joined: 4th Jun 2004
Location:
Posted: 25th Dec 2014 22:54
testing the tictactoe game out of Hands On AppGameKit Basic. Input the tictactoe game. not sure if i am testing this right... I have an android table and my laptop. doing the development on my laptop using latest agk2. to test it, I am broadcasting it to my android tablet. It runs there. Now to run it on my laptop, i go to the tictactoe directory and doubleclick on the tictactoe.exe. It also runs. But, when it try to get them to connect to each other over the wireless (push host button on one and client on the other device), they never connect. Is this the right method for testing a network app??
this is not just a tictactoe question, but a question about how to test your network capable apps, I guess....

thanks!
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 25th Dec 2014 22:57
We probably need to see your code to help with this.

Cheers,
Ancient Lady
roujesky
20
Years of Service
User Offline
Joined: 4th Jun 2004
Location:
Posted: 25th Dec 2014 23:19 Edited at: 25th Dec 2014 23:21

this is the code i copied out of the hands on book
Alistair
18
Years of Service
User Offline
Joined: 4th Oct 2006
Location: Scotland
Posted: 26th Dec 2014 10:49
@joujesky I've had a quick look through the two functions you've listed here and don't see any obvious problems or differences from the
book.
I've tried running the original code under AppGameKit 2 and its seems to work fine (after changing Mod())with my PC and tablet talking to each other correctly.
If you'd like to email me at alistair@digital-skills.co.uk, I'll send
you a copy of the working code and you can see if you made a typo somewhere else in your own code.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 26th Dec 2014 15:48
did it work with port 1025 ?
i wonder myself how the JoinNetwork work without this port parameter.

AGK 108 (B)19 + AppGameKit V2 Alpha .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
roujesky
20
Years of Service
User Offline
Joined: 4th Jun 2004
Location:
Posted: 26th Dec 2014 17:34 Edited at: 26th Dec 2014 17:37
allistair:
I sent you an email. thanks
Markus:
I just changed it to 1025 and it made no difference

I am wondering if my testing methods are causing the problem? I am now using a Nexus 7 tablet. In the IDE, I click on Broadcast and see it running on the tablet. Next, I click on Run in the IDE and see it run on my laptop development system. In Tictactoe, I click on HOST on the Laptop and JOIN on the tablet. 30 second timeout on both machines because they did not connect.

The code is in this loop for 30 seconds trying to sonnect:

repeat
print(GetSeconds())
Sync()
until GetNetworkNumClients(netid)=2 or GetSeconds()-time>30

Just thought of this... I am running WIdnows 7 using Microsoft Security Essentials. Could this be a security or firewall thing????


thanks!
roujesky
20
Years of Service
User Offline
Joined: 4th Jun 2004
Location:
Posted: 26th Dec 2014 20:07
I dropped in Alistair's code and have the same exact problem. I tuurned off windows firewall and that did not help.

any ideas? this is not a code problem, it sounds like a configuration problem. Or I am testing incorrectly?

thanks!
roujesky
20
Years of Service
User Offline
Joined: 4th Jun 2004
Location:
Posted: 26th Dec 2014 20:16
Hold the presses!!! It works now, kinda....
Up til now, I had the laptop be the host and tablet the client. (PCs are always host in my old mind..?) this time the tablet host and laptop client. and now I play tictactoe!

why do you think that matters?????

thanks!
AlistairS
11
Years of Service
User Offline
Joined: 28th Apr 2013
Location: U.K.
Posted: 27th Dec 2014 07:42
@roujesky
When I tested the code I sent you, I used the PC as the host without
any problems, so I'm not exactly sure what your problem is. But please post if you discover what the problem is since I'm interested to find out so I can warn people about it in the next edition of the book.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 27th Dec 2014 10:52
It may be that your PC cannot broadcast on Port 45631. This is the port used to broadcast the message that an AppGameKit network exists and is awaiting clients.

Start the App, and then in a command window run

netstat -a

to see if the port is open.

Quidquid latine dictum sit, altum sonatur
roujesky
20
Years of Service
User Offline
Joined: 4th Jun 2004
Location:
Posted: 28th Dec 2014 04:46
i ran netstat -a and ported it to a file to save. I have attached the file. I dont see a 45631 in the file.....

Attachments

Login to view attachments
roujesky
20
Years of Service
User Offline
Joined: 4th Jun 2004
Location:
Posted: 28th Dec 2014 05:59
all:
I am still very interested in pinpointing the problem here, BUT I have to leave and go off line for a week. I will check back when I get back.

thanks to everyone.

Login to post a reply

Server time is: 2024-11-25 14:43:27
Your offset time is: 2024-11-25 14:43:27