@@ -59,7 +59,7 @@ int WiFiClient::connect(IPAddress ip, uint16_t port)
59
59
{
60
60
sockfd = socket (AF_INET, SOCK_STREAM, 0 );
61
61
if (sockfd < 0 ) {
62
- log_e (" error : %d" , errno);
62
+ log_e (" socket : %d" , errno);
63
63
return 0 ;
64
64
}
65
65
uint32_t ip_addr = ip;
@@ -70,7 +70,7 @@ int WiFiClient::connect(IPAddress ip, uint16_t port)
70
70
serveraddr.sin_port = htons (port);
71
71
int res = lwip_connect_r (sockfd, (struct sockaddr *)&serveraddr, sizeof (serveraddr));
72
72
if (res < 0 ) {
73
- log_e (" error : %d" , errno);
73
+ log_e (" lwip_connect_r : %d" , errno);
74
74
close (sockfd);
75
75
sockfd = -1 ;
76
76
return 0 ;
@@ -94,7 +94,7 @@ int WiFiClient::setSocketOption(int option, char* value, size_t len)
94
94
{
95
95
int res = setsockopt (sockfd, SOL_SOCKET, option, value, len);
96
96
if (res < 0 ) {
97
- log_e (" error: %d" , errno);
97
+ log_e (" %d" , errno);
98
98
}
99
99
return res;
100
100
}
@@ -114,7 +114,7 @@ int WiFiClient::setOption(int option, int *value)
114
114
{
115
115
int res = setsockopt (sockfd, IPPROTO_TCP, option, (char *)value, sizeof (int ));
116
116
if (res < 0 ) {
117
- log_e (" error: %d" , errno);
117
+ log_e (" %d" , errno);
118
118
}
119
119
return res;
120
120
}
@@ -124,7 +124,7 @@ int WiFiClient::getOption(int option, int *value)
124
124
size_t size = sizeof (int );
125
125
int res = getsockopt (sockfd, IPPROTO_TCP, option, (char *)value, &size);
126
126
if (res < 0 ) {
127
- log_e (" error: %d" , errno);
127
+ log_e (" %d" , errno);
128
128
}
129
129
return res;
130
130
}
@@ -164,7 +164,7 @@ size_t WiFiClient::write(const uint8_t *buf, size_t size)
164
164
}
165
165
int res = send (sockfd, (void *)buf, size, MSG_DONTWAIT);
166
166
if (res < 0 ) {
167
- log_e (" error: %d" , errno);
167
+ log_e (" %d" , errno);
168
168
_connected = false ;
169
169
sockfd = -1 ;
170
170
res = 0 ;
@@ -179,7 +179,7 @@ int WiFiClient::read(uint8_t *buf, size_t size)
179
179
}
180
180
int res = recv (sockfd, buf, size, MSG_DONTWAIT);
181
181
if (res < 0 && errno != EWOULDBLOCK) {
182
- log_e (" error: %d" , errno);
182
+ log_e (" %d" , errno);
183
183
_connected = false ;
184
184
sockfd = -1 ;
185
185
}
@@ -194,7 +194,7 @@ int WiFiClient::available()
194
194
int count;
195
195
int res = ioctl (sockfd, FIONREAD, &count);
196
196
if (res < 0 ) {
197
- log_e (" error: %d" , errno);
197
+ log_e (" %d" , errno);
198
198
_connected = false ;
199
199
sockfd = -1 ;
200
200
return 0 ;
0 commit comments