Update tcp_client.c
This commit is contained in:
@@ -22,8 +22,12 @@ void application_entry(void *arg)
|
||||
|
||||
MX_LWIP_Init();
|
||||
|
||||
while (1) {
|
||||
socketfd = socket(AF_INET, SOCK_STREAM, 0);
|
||||
while (1) {
|
||||
if ((socketfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
|
||||
printf("create socket error %s errno: %d\n", strerror(errno), errno);
|
||||
goto tcp_client_exit;
|
||||
}
|
||||
|
||||
setsockopt(socketfd, SOL_SOCKET, SO_RCVTIMEO, (char*)&tv, sizeof(struct timeval));
|
||||
memset(&sockaddr, 0, sizeof(sockaddr));
|
||||
|
||||
|
Reference in New Issue
Block a user