| Title: | DECWINDOWS 26-JAN-89 to 29-NOV-90 |
| Notice: | See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit |
| Moderator: | STAR::VATNE |
| Created: | Mon Oct 30 1989 |
| Last Modified: | Mon Dec 31 1990 |
| Last Successful Update: | Fri Jun 06 1997 |
| Number of topics: | 3726 |
| Total number of notes: | 19516 |
I am trying to set up my applcation to listen on an INET domain
stream socket. I create it in the usual manner, letting ULTRIX
fill in the port field in sockaddr_in. Then I bind it, call
listen, and use the socket fds in an XtAppAddInput call (with
read mask).
Problem is that when the first X event is handed to my application,
it croaks in _XWaitForSomething.
This code works perfectly fine when a socketpair, (obviously created
in the UNIX domain) is used....
Is there any limitation on which kind of sockets may be used with
the toolkit..?
| T.R | Title | User | Personal Name | Date | Lines |
|---|---|---|---|---|---|
| 3264.1 | ABYSS::dike | Tue Aug 28 1990 07:09 | 27 | ||
I have done that (XtAddInput on an inet stream socket) without any problems.
Here are the relevent bits of code:
int i, s;
struct sockaddr_in sa;
if((s = socket(AF_INET, SOCK_STREAM, 0)) == -1){
perror("socket");
exit(1);
}
sa.sin_family = AF_INET;
for(i=MIN_PORT;i<MAX_PORT;i++){
sa.sin_port = i;
if(bind(s, &sa, sizeof(sa)) != -1) break;
}
if(i == MAX_PORT){
perror("bind");
exit(1);
}
if(listen(s, 5) == -1){
perror("listen");
exit(1);
}
...
XtAddInput(s, XtInputReadMask, do_accept, NULL);
| |||||
| 3264.2 | SX4GTO::HOLT | Robert Holt ISVG West | Tue Aug 28 1990 11:07 | 4 | |
Mine works when XtAddInput is substituted for XtAppAddInput...
odd.
| |||||