PDA

View Full Version : Experiment in Client Server communication


Mike Halliday
08-11-2008, 08:27 PM
Hi Guys,

I have been playing with socket communications to see how easy they really are (for 2 player remote games etc)

The archives contains 2 .exe files (Client.exe and Server.exe) 1 config file and 2 sprites.

See if you get any results with this please and report back to me so I can continue testing and see if my coding works (probably not! ha ha)

This must be run on 2 seperate machines on a local network, or in a virtual session!

Change both config.txt to match the IP of the server machine - you can change the port too, but I get good results using the default. (The IP must be the same as the server uses it for config info and the client for connection info)

Put Server.exe, 2.bmp and config.txt in the same folder on 1 machine and run the exe
Put Client.exe, 1.bmp and config.txt in the same folder on another machine and run the exe

Once the connection is made on the client you should be able to click and move the mouse. The red ball should follow the cursor on the client screen, but also at the same time the dark coloured ball should match the movement on the server screen.

On my test system it is a bit erratic, but then again I am remotely controlling the lan server via the internet while running the client on the local lan - so thats probably why.

Its the principle I want to test and not the actual coding. - My code is documented so if I get confirmation that it works in part, I will include it on the forum or in a newsletter tutorial as I know there have been a few questions on socket programming in the past.

Ta.

Mike.

(A small point for Alain to consider. It won't let me upload a .zip file bigger than 481Kb - this makes it difficult to upload PPL creations even when compiled with the compact runtimes)

Nicknack
08-12-2008, 03:38 PM
i have tested it here on two pcs in the same lan and it's behaving strange:
in the right bottom fourth the ball doesn't move erratic (in fact even quite smooth), but on the rest of the screen it does :-|
i will also try it out on ppc and i'm looking forward for the code :D

Mike Halliday
08-12-2008, 03:56 PM
i have tested it here on two pcs in the same lan and it's behaving strange:
in the right bottom fourth the ball doesn't move erratic (in fact even quite smooth), but on the rest of the screen it does :-|
i will also try it out on ppc and i'm looking forward for the code :D


Yeah, thats the response I wanted! :) - Thanks NickNack.

I will try and streamline the code and stop the erratic movements. It is something to do with the transmission speed of the co-ords from the client to the server. :confused:

Need more testings and also a compile on the PPC to see if it can work via Active sync or Wireless! :)

PointOfLight
08-12-2008, 05:25 PM
I will try this out when I get home tonight. I meant to test it yesterday, but by the time I got home and got to my computer I completely forgot about it :)