|
Home > Archive > Unix Programming > September 2006 > sendto:: Invalid argument.
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
sendto:: Invalid argument.
|
|
| DaVinci 2006-09-21, 7:33 am |
|
#define PORT 2223
why htonl(PORT) will make sendto()
if(sendto(sockfd,buff3,10,0,
(struct sockaddr*)&sad,sizeof(sad))<0)
error,but htons(PORTPort) will not ?
the error is :
sendto:: Invalid argument.
| |
| DaVinci 2006-09-21, 7:33 am |
|
DaVinci wrote:
> #define PORT 2223
> why htonl(PORT) will make sendto()
> if(sendto(sockfd,buff3,10,0,
> (struct sockaddr*)&sad,sizeof(sad))<0)
> error,but htons(PORTPort) will not ?
> the error is :
>
> sendto:: Invalid argument.
I am sorry to touble all of your.
Maybe I know the answer now,
The Port is 16bit.
so htons() is right choice.
|
|
|
|
|