[comp.windows.x] XtAddInput using AF_INET and SOCK_DGRAM

yakker@ucrmath.ucr.edu (matt robinson) (11/24/90)

Well, guys, I'm at a tough spot.  From what I can tell, the program
I am writing cannot use both of these at the same time.  I don't have
the manuals for this available, so I don't know what the proper syntax
for using this is:  This is what I am doing at this point:

	int sock;
	void GetSocketInput();
.
.
.
	if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
	{
		(void)XtShowError("The socket() function failed.  Exiting.\n");
		(void)Cleanup();
		(void)exit(1);
	}
	(void) XtAddInput(sock, XtInputReadMask, GetSocketInput, 0);
.
.
.

And the function I am writing for it reads in the data, but for 
testing purposes, a fprintf() is only needed to signify that the
selection is being made on the socket descriptor:

void GetSocketInput(nothing, fid, id)
caddr_t		nothing;
int			*fid;
XtInputId	*id;
{
	(void) fprintf(stderr, "Hello, people, I can read input!!\n");
}

Can someone tell me the proper syntax for doing this?  I'm not
sure right off hand what the exact mistake is, so I'll ask you
pros out there the right answer.  I want to read data from a 
datagram socket across Internet sockets.  Any suggestions, clues,
etc?  Thanks, people, I appreciate the help in advance.

--Matt