TCP Server/Client dilemma

BlitzPlus Forums/BlitzPlus Programming/TCP Server/Client dilemma

gburgess(Posted 2004) [#1]
Maybe I'm just being really dense.

I'm trying to write a recording-keeping program for the school I work at, for storing uninteresting admin info about our students. I wanted to make it run off our server, so that staff could run the client from around the school and update as and when.

Source code is here:
http://www.hailofbullets.co.uk/dirty/student_pod.zip

Quick bit of into about the program:

To use it:
Go into the server folder and run "SPS.bb" which is the server. Then go to the client, open config.ini and put your local IP in there. Then run the client. The server should pick up a request from the client for a list of available classes. This works fine. If you click on "Students" in the client, the drop down menu has a list of the classes it got from the server. Now, put in a first and last name in the boxes, and click "add student". The client goes through the same process as requesting the class list: it sends a string with a request, the server reads it and acts on it accordingly.

Wierdly, the server only ever seems to recieve the request_classlist string at the beginning of the program, but not the incoming_newstudent string. I tried a few experiements, and it seems able to recieve "request_classlist" over and over if I keep sending it from the client every loop, but nothing else seems to work.

I wondered if this was down to running the client and server on the same machine while I was testing. Unfortunately, both the machines I was about to set up as servers today to try this remotely have abruptly failed for different, unrelated reasons. I'm very narked off because one of them's my new laptop.

So, anyway, if anyone can be arsed to wade through it, I'd really like to know what I'm doing wrong.

Cheers, folks.

-Glenn


semar(Posted 2004) [#2]
Glenn,
I didn't check your code, anyway, you could check mine instead, is a complete lan/internet chat program that uses tcp, you find it in the code archive :

http://www.blitzbasic.com/codearcs/codearcs.php?code=28

Hope this helps,
Sergio.