Merge pull request #91 from DavidLin1577/patch-7
Minor optimisation to the tcp_server code
This commit is contained in:
@@ -51,7 +51,7 @@ void application_entry(void *arg)
|
|||||||
buff[n] = '\0';
|
buff[n] = '\0';
|
||||||
printf("recv(%d) msg from client:%s\n", ++cnt, buff);
|
printf("recv(%d) msg from client:%s\n", ++cnt, buff);
|
||||||
if ((send(connfd, buff, strlen(buff), 0)) < 0) {
|
if ((send(connfd, buff, strlen(buff), 0)) < 0) {
|
||||||
printf("send mes error: %s errno : %d\n", strerror(errno), errno);
|
printf("send msg error: %s errno : %d\n", strerror(errno), errno);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
close(connfd);
|
close(connfd);
|
||||||
|
Reference in New Issue
Block a user