[comp.unix.questions] Using poll

kc@cbnewsl.att.com (keith.coulson) (12/15/90)

In article <1990Dec14.193732.5121@world.std.com>, bunyip@world.std.com (Jason W May) writes:
> 
> Under TLI, is it possible to poll() on a file descriptor that is associated
> with a UDP transport provider?  e.g.,
> 
> 
> 	int fd;
> 	struct pollfd pollfd;
> 	struct t_unitdata *udataptr;
> 
> 
> 	fd = t_open ("/dev/udp", O_RDWR, NULL);
> 
> 	/* t_bind, t_alloc, etc. */
> 
> 	pollfd.fd = fd;
> 	poll (&pollfd, 1, -1);
> 
> 	t_rcvudata (fd, udataptr, &flags);
> 
> 
> When I try this, the poll() never returns.  Things work fine if I leave
> out the poll and the server just waits for a datagram to arrive; but I
> would like to multiplex and listen on a set of streams where several
> could be connection-oriented and several connectionless.
> 
> 
> Thanks,
> 
> Jason (bunyip@world.std.com)

Did you set the events field of pollfd (e.g. pollfd.events = POLLIN)

Keith Coulson
kc@cbnewsl.att.com

bunyip@world.std.com (Jason W May) (12/15/90)

Under TLI, is it possible to poll() on a file descriptor that is associated
with a UDP transport provider?  e.g.,


	int fd;
	struct pollfd pollfd;
	struct t_unitdata *udataptr;


	fd = t_open ("/dev/udp", O_RDWR, NULL);

	/* t_bind, t_alloc, etc. */

	pollfd.fd = fd;
	poll (&pollfd, 1, -1);

	t_rcvudata (fd, udataptr, &flags);


When I try this, the poll() never returns.  Things work fine if I leave
out the poll and the server just waits for a datagram to arrive; but I
would like to multiplex and listen on a set of streams where several
could be connection-oriented and several connectionless.


Thanks,

Jason (bunyip@world.std.com)