Hmm. The point of cof_pktDreceive() is for a costate to yield until a character arrives. If you're using costates in your program, you'd typically have one dedicated to receiving messages so it's not a problem if it blocks until a packet arrives.
You can call pktDreceive() instead if you need non-blocking reads. it will return 0 if there aren't any characters available to read.
Note that Digi provides source to all of its libraries so you can see how each function works. Here's the source to cof_pktDreceive():
Code:
nodebug scofunc int cof_pktDreceive(void *buffer, int buffer_size)
{
auto int length;
while((length = pktDreceive(buffer, buffer_size)) == 0)
{
yield;
}
return length;
}