Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* setsockopt() problems!!
@ 1993-04-22 12:07 Randy Parlier
  0 siblings, 0 replies; 2+ messages in thread
From: Randy Parlier @ 1993-04-22 12:07 UTC (permalink / raw)



	(Sorry, this was supposed to go to comp.unix.osf.osf1)

	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] 2+ messages in thread
* setsockopt() problems!!
@ 1993-04-22 11:58 Randy Parlier
  0 siblings, 0 replies; 2+ messages 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] 2+ messages in thread

end of thread, other threads:[~1993-04-22 12:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1993-04-22 12:07 setsockopt() problems!! Randy Parlier
  -- strict thread matches above, loose matches on Subject: below --
1993-04-22 11:58 Randy Parlier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox