I am using Kylix C for this console application, but I am trying to keep it
> simple since this has to go
> in a smaller embedded thing. So I use, "socket", "connect" and "send" to get
> it out and it is correctly received at the desired port no. (at present set
> to 5001) I can also see that the source port no. is different - 1025 and I
> don't think it should be that. Now comes the real annoyance. When I send a
> message back to the Linux PC it listens at port 1025 and not 5001 as I want
> it to do. I have tried both "recv" and "recvfrom" to receive the message.
That's the way it usually works. The client connects from a unknown random port above 1024, to the specific server port (i.e. 5001). the server then sends the data back the same channel from the known port (5001) to the unknown port (1025).
You can change the client to always use a known port to start with if you want by using the bind() call, but usually the first way works fine.
regards