MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / do_read

Function do_read

examples/network/chargen.c:212–225  ·  view source on GitHub ↗

* void do_read(struct charcb *p_charcb) * * Socket definitely is ready for reading. Read a buffer from the socket and * discard the data. If no data is read, then the socket is closed and the * charcb is removed from the list and freed. **************************************************************/

Source from the content-addressed store, hash-verified

210 * charcb is removed from the list and freed.
211 **************************************************************/
212static int do_read(struct charcb *p_charcb)
213{
214 char buffer[80];
215 int readcount;
216
217 /* Read some data */
218 readcount = read(p_charcb->socket, &buffer, 80);
219 if (readcount <= 0)
220 {
221 close_chargen(p_charcb);
222 return -1;
223 }
224 return 0;
225}
226
227void chargen_init(void)
228{

Callers 1

chargen_threadFunction · 0.85

Calls 2

close_chargenFunction · 0.85
readFunction · 0.50

Tested by

no test coverage detected