Thanks for the response's. I suspect the "127.0.0.1" I used for the server is real problem. The "C" program that I converted (C is not a language that I know), used something about INADDRESS_ANY, but did not say what the actual value was, just that it was any address. So I tried the 127..., and It worked OK while I tested the two programs on the same computer, so I left it at that.
I don't really know a lot about Networks, I can just about get PC's talking to each other. So long as nothing goes wrong. In which case I tend to get a bit stuck.
I should also have known better than to do this test on Friday the 13th...
I finally managed to get a two way chat program in assembler working between two QPC2's , using a TCP connection (After much trial and error, I gave up for the moment on trying to get a UDP connection working in both directions).
There are two programs, a Client, and a Server. See the ReadMe file in the Zip for details, but basically you have each program running in a copy of QPC2 on two computers, or two copies of QPC2 running on the same computer. You type a message into one QPC2, and it appears on the other.
I have only tested the programs on QPC2, but they should work on other emulators that support the IP drivers.
I have also included a small program (IPData), that I put together while playing with the IP drivers. It supplies some basic data about a IP channel ID. It shows the last Linux/C error number that occurred from one of the IP system trap calls, and the IP addresses and Port numbers for the host and peer connections for the IP channel ID.
The document (IPManual), Is a document to aid in programming in assembler, that I have cobbled together as I have been going along, from documents by Richard Zidlicky and Jonathan Hudson, and from 'C' code and information from the internet.
It lists and describes the IP system calls, and data structures used. It also includes a list of 'C' error codes and descriptions to help you when debugging machine code programs.
The document is unfinished, and still very much a work in progress, so it's bit patchy. However I have included it here in case anyone is interested in programming the IP drivers in assembler, or to help if anyone wants to understand the Client/Server program.
The document is intended to be printed as a booklet on A5 paper.
This is an update to my IP manual (see above post). It's been tidied up a bit, and I've tried to make the descriptions of the commander clearer.
I have also included some observations I have made on what IP ports will, and will not open.
I have still not been able to get the UDP, sendto and recvfrom commands to work in QPC2. And UDP ports seem to be unreliable, in that sometime they work as expected, and sometime they don't.
Also on some quick tests with Qemulator, it does not seem to want to open UDP ports at all.