I just noticed that the socket address structure is packed using "c4" - four signed chars. This should be four unsigned chars, "C4". On my SunOS system it seems to make no difference (i tried it using both formats connecting to a number of systems) but SunOS has a good record of automatically guessing right about these things - it may matter on other systems.