* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
Download Communication
Wake-on-LAN wikipedia , lookup
TCP congestion control wikipedia , lookup
Dynamic Host Configuration Protocol wikipedia , lookup
Parallel port wikipedia , lookup
Remote Desktop Services wikipedia , lookup
Cracking of wireless networks wikipedia , lookup
Zero-configuration networking wikipedia , lookup
Recursive InterNetwork Architecture (RINA) wikipedia , lookup
Internet protocol suite wikipedia , lookup
Example (Stream Socket;
setting address)
setaddr(struct sockaddr_in *sp, char *host, int port)
{
struct hostent *hp;
hp = gethostbyname(host);
if (hp == NULL) {
fprintf(stderr, "%s: unknown host\n", host);
exit(1);
}
sp->sin_family = AF_INET;
bcopy(hp->h_addr, &sp->sin_addr, hp->h_length);
sp->sin_port = htons(port);
}