Re: receiving data with soreceive
Re: receiving data with soreceive
- Subject: Re: receiving data with soreceive
- From: Justin Walker <email@hidden>
- Date: Sat, 14 May 2005 15:39:02 -0700
On May 14, 2005, at 15:22, Bijoy Thomas wrote:
What do you mean by so upcall?
An "upcall" is techno-speak for a procedure call that, in a sense,
reverses the usual flow of control in, say, a network stack. It's also
known as a callback, and is a procedure call initiated on the
occurrence of an event, e.g., an incoming packet. The procedure to
call is usually registered with some kind of call; it's part of the new
KPI for sockets, for example.
Are you calling soreceive in an so upcall? If so, try setting
MSG_DONTWAIT in the flags, and that should give you everything that
is in the so buf at that point. MSG_DONTWAIT tells the socket not to
block. For the auio resid, use M_COPYALL.
This is an alternative, but keep in mind that using this means that
your code has to make sure all the data you need is in place,
essentially by reconstructing the incoming packet byte-by-byte (i.e.,
you need to make sure enough bytes are present to form a valid header
so you can read the length, so you can make sure enough bytes are
present to process the rest of the packet, ....). It also means you
are polling for data, which may not be the best idea.
Cheers,
Justin
--
Justin C. Walker, Curmudgeon-At-Large
Institute for General Semantics
--------
If you're not confused,
You're not paying attention
--------
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden