* setsockopt() problems!!
@ 1993-04-22 11:58 Randy Parlier
0 siblings, 0 replies; only message in thread
From: Randy Parlier @ 1993-04-22 11:58 UTC (permalink / raw)
I am attempting to port some socket code to OSF/1 originally
written on a Sun.
Below is a portion of the code I am having trouble with.
setsockopt() always returns -1 and perror prints "Socket is not
connected".
Can anyone point out where/what I'm doing wrong?? I'm running
OSF/1 on a DEC Alpha OS release version 1.2.
Thanks
Randy
parlier@puente.jpl.nasa.gov
P.S. Does OSF/1 or SYSVr4 have a command similiar to the 'trace'
command on SunOS?
----------------- Here's the code ----------------
create_control_socket() /* Set up socket for listening to control msgs. */
{
int error_found;
control_inet_name_ptr = (struct sockaddr_in *) (&control_socket_name);
control_inet_name_ptr->sin_family = AF_INET;
control_inet_name_ptr->sin_port = CONTROL_PORT;
control_inet_name_ptr->sin_addr.s_addr = INADDR_ANY;
control_socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (control_socket == NONE)
{
perror("TPSEXEC failed on control socket call");
exit(1);
}
error_found = setsockopt(control_socket, SOL_SOCKET,
SO_REUSEADDR, 0, 0);
if (error_found)
{
perror("TPSEXEC failed on control port setsockopt");
exit(1);
}
error_found = bind(control_socket, &control_socket_name,
sizeof(control_socket_name));
if (error_found)
{
perror("TPSEXEC failed on control socket bind");
exit(1);
}
error_found = listen(control_socket, 2);
if (error_found)
{
perror("TPSEXEC failed on control socket listen");
exit(1);
}
FD_SET(control_socket, &multiplex);
return;
} /* End of create_control_socket routine. */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1993-04-22 11:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1993-04-22 11:58 setsockopt() problems!! Randy Parlier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox