[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: connect() succeeds after n-attempts.... why?



In article <[🔎] 30BFDEA66FF4D41191EB00D0B765BC6F05B8D7@medha.wsspl.com>,
Wilson  <Wilson@WSSPL.com> wrote:
>Hello,
>Ive a problem. I wrote a sample TCP client which tries to connects to some
>server (IPAddress:Port) in a loop. The connect() call succeeds after few
>attempts.
>We tried the same code on HP-UX and Solaris, where it was working properly
>(caonnect() failing all the time...)
>
>        addr.sin_port = 10000;

Common programming error.

This should be addr.sin_port = htons(10000);

Otherwise you're probably connecting to port 4135.

Mike.


-- 
To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: