int port;
struct sockaddr_in sockaddr;
int tmp;
- struct protoent *protoent;
int tmp_desc;
port_str = strchr (name, ':');
if (remote_desc == -1)
perror_with_name ("Accept failed");
- protoent = getprotobyname ("tcp");
- if (!protoent)
- perror_with_name ("getprotobyname");
-
/* Enable TCP keep alive process. */
tmp = 1;
setsockopt (tmp_desc, SOL_SOCKET, SO_KEEPALIVE, (char *) &tmp, sizeof (tmp));
/* Tell TCP not to delay small packets. This greatly speeds up
interactive response. */
tmp = 1;
- setsockopt (remote_desc, protoent->p_proto, TCP_NODELAY,
+ setsockopt (remote_desc, IPPROTO_TCP, TCP_NODELAY,
(char *) &tmp, sizeof (tmp));
close (tmp_desc); /* No longer need this */
int port;
struct sockaddr_in sockaddr;
int tmp;
- struct protoent *protoent;
int tmp_desc;
port_str = strchr (name, ':');
if (remote_desc == -1)
perror_with_name ("Accept failed");
- protoent = getprotobyname ("tcp");
- if (!protoent)
- perror_with_name ("getprotobyname");
-
/* Enable TCP keep alive process. */
tmp = 1;
setsockopt (tmp_desc, SOL_SOCKET, SO_KEEPALIVE, (char *) &tmp, sizeof (tmp));
/* Tell TCP not to delay small packets. This greatly speeds up
interactive response. */
tmp = 1;
- setsockopt (remote_desc, protoent->p_proto, TCP_NODELAY,
+ setsockopt (remote_desc, IPPROTO_TCP, TCP_NODELAY,
(char *) &tmp, sizeof (tmp));
close (tmp_desc); /* No longer need this */