mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #12329 from jeromecoutant/PR_ATCELL
AT_CellularStack: crash during TCP testpull/12472/head
commit
586341541c
|
@ -429,10 +429,12 @@ void AT_CellularStack::socket_attach(nsapi_socket_t handle, void (*callback)(voi
|
||||||
int AT_CellularStack::get_socket_index_by_port(uint16_t port)
|
int AT_CellularStack::get_socket_index_by_port(uint16_t port)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < _device.get_property(AT_CellularDevice::PROPERTY_SOCKET_COUNT); i++) {
|
for (int i = 0; i < _device.get_property(AT_CellularDevice::PROPERTY_SOCKET_COUNT); i++) {
|
||||||
|
if (_socket[i] != 0) {
|
||||||
if (_socket[i]->localAddress.get_port() == port) {
|
if (_socket[i]->localAddress.get_port() == port) {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue