|
@ -70,6 +70,10 @@ void *netclient_thread(void *arg) { |
|
|
char buff[4096]; |
|
|
char buff[4096]; |
|
|
int n = 0; |
|
|
int n = 0; |
|
|
while ((n = read(client->fd, buff, 4096)) >= 0) { |
|
|
while ((n = read(client->fd, buff, 4096)) >= 0) { |
|
|
|
|
|
if (n == 0) { |
|
|
|
|
|
//返回零意味着对方关闭socket,超时返回的是负数
|
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
printf("net->uart: %d\n", n); |
|
|
printf("net->uart: %d\n", n); |
|
|
printf_buf(buff, n); |
|
|
printf_buf(buff, n); |
|
|
uartSend(&g_uart_device, buff, n); |
|
|
uartSend(&g_uart_device, buff, n); |
|
|