Darren Reed writes: > Picking up a packet from below is fine, and it can be put into a > buffer attached to the q_ptr ok.
putq (perhaps with noenable if necessary) is the usual way to do this, but you're also free to invent your own mechanisms if you must. > Copying the data into the buffer > would need to be protected by holding some lock so that this is > synchronised with the reader from above. putq handles these issues. If you do it yourself, you'll need to reimplement this. > For reference, in the immediate delivery mode, the buffer is > checked against a BPF filter before being passed along to > the next module. OK. > With delayed wait we don't want to just call "putnext" to > deliver the message onwards and upwards, rather we want > to either: > > 1) tell the system that a buffer is waiting to be read (with > 0 or more bytes ready) so that select/poll wakeup; I'm confused. You do that implicitly by calling putnext. The stream head will then enable the waiter(s) if necessary. Why would you want to wake up the reader without actually delivering any data? Why does it need to be divorced from putnext? > Clues anyone? Can you provide more details on _exactly_ what sort of behavior you desire? If you're gathering up data so that you can deliver it in a burst, then doing noenable on the read-side queue, putq for each packet, and qtimeout when q_first is NULL should do the trick. On timer expiry, the queue service procedure will be enabled, and you can do the bulk putnext at that point. But, presumably, that's not what you want to do, because you're explicitly talking about select/poll here rather than STREAMS behavior. In that case, I think it'd help greatly if you could describe what sort of functionality the application needs to get from the system, or if you could point to a reference document that describes what you're trying to implement. -- James Carlson, KISS Network <[EMAIL PROTECTED]> Sun Microsystems / 1 Network Drive 71.232W Vox +1 781 442 2084 MS UBUR02-212 / Burlington MA 01803-2757 42.496N Fax +1 781 442 1677 _______________________________________________ networking-discuss mailing list [email protected]
