File tree 1 file changed +2
-4
lines changed
libraries/SocketWrapper/src
1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ void arduino::MbedClient::setSocket(Socket *_sock) {
60
60
void arduino::MbedClient::configureSocket (Socket *_s) {
61
61
_s->set_timeout (_timeout);
62
62
_s->set_blocking (false );
63
+ _s->getpeername (&address);
63
64
64
65
if (event == nullptr ) {
65
66
event = new rtos::EventFlags;
@@ -99,7 +100,6 @@ int arduino::MbedClient::connect(SocketAddress socketAddress) {
99
100
return 0 ;
100
101
}
101
102
102
- address = socketAddress;
103
103
nsapi_error_t returnCode = static_cast <TCPSocket *>(sock)->connect (socketAddress);
104
104
int ret = 0 ;
105
105
@@ -150,8 +150,6 @@ int arduino::MbedClient::connectSSL(SocketAddress socketAddress) {
150
150
return 0 ;
151
151
}
152
152
153
- address = socketAddress;
154
-
155
153
restart_connect:
156
154
nsapi_error_t returnCode = static_cast <TLSSocket *>(sock)->connect (socketAddress);
157
155
int ret = 0 ;
@@ -304,7 +302,7 @@ IPAddress arduino::MbedClient::remoteIP() {
304
302
}
305
303
306
304
uint16_t arduino::MbedClient::remotePort () {
307
- return 0 ;
305
+ return address. get_port () ;
308
306
}
309
307
310
308
void arduino::MbedClient::setTimeout (unsigned long timeout) {
You can’t perform that action at this time.
0 commit comments