Im running the Sample TCP client application for the q2627. This application establishes a connection and sends data stored in a buffer. The wip_write functionion is called to do this. However, this function is called only when WIP_CEV_WRITE is given to the event handler.
My question is, what triggers this event? I was thinking it is triggered if data is present in the buffer, but I dont see how this buffer is linked to any events.
case WIP_CEV_WRITE: {
int nwrite;
wip_debug ("[SAMPLE] Can send more data\n");
[b] nwrite = wip_write( ev->channel, snd_buffer + snd_offset,[/b]
sizeof( snd_buffer) - snd_offset);
if( nwrite < 0) { wip_debug( "[SAMPLE] write error %i\n", nwrite); return; }
snd_offset += nwrite;
if( snd_offset == sizeof( snd_buffer)) {
wip_debug( "[SAMPLE] Everything has been sent, won't send more.\n");
} else {
wip_debug( "[SAMPLE] Wrote %i bytes. "
"%i bytes left to send in snd_buffer\n",
nwrite, sizeof( snd_buffer) - snd_offset);
}
break;
Does anyone know how to trigger this event??