| 72 | } |
| 73 | |
| 74 | int sockgetcharcli(struct clientparam * param, int timeosec, int timeousec){ |
| 75 | int len; |
| 76 | |
| 77 | if(!param->clibuf){ |
| 78 | if(!(param->clibuf = myalloc(BUFSIZE))) return 0; |
| 79 | param->clibufsize = BUFSIZE; |
| 80 | param->clioffset = param->cliinbuf = 0; |
| 81 | } |
| 82 | if(param->cliinbuf && param->clioffset < param->cliinbuf){ |
| 83 | return (int)param->clibuf[param->clioffset++]; |
| 84 | } |
| 85 | param->clioffset = param->cliinbuf = 0; |
| 86 | if ((len = sockrecvfrom(param->clisock, (struct sockaddr *)¶m->sincr, param->clibuf, param->clibufsize, timeosec*1000 + timeousec))<=0) return EOF; |
| 87 | param->cliinbuf = len; |
| 88 | param->clioffset = 1; |
| 89 | return (int)*param->clibuf; |
| 90 | } |
| 91 | |
| 92 | int sockfillbuffcli(struct clientparam * param, unsigned long size, int timeosec){ |
| 93 | int len; |
no test coverage detected