Using poll() on a UDP stream in TLI

keith.coulson kc at cbnewsl.att.com
Sat Dec 15 06:05:57 AEST 1990


In article <1990Dec14.193732.5121 at world.std.com>, bunyip at 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 at world.std.com)

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

Keith Coulson
kc at cbnewsl.att.com



More information about the Comp.unix.questions mailing list