Skip to content

Commit d741c13

Browse files
committed
nsapi: Changed initial state of sockets to allow events
Note, the registered callback is still disabled by a call to socket_attach. This will avoid being called after the socket is closed unless close is called from the attached callback, which is in irq context. As pointed out by kjbracey-arm, the previous behaviour was broken for sockets that started out listening.
1 parent 04a31f3 commit d741c13

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

features/netsocket/TCPServer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include "mbed.h"
1919

2020
TCPServer::TCPServer()
21-
: _pending(1), _accept_sem(0)
21+
: _pending(0), _accept_sem(0)
2222
{
2323
}
2424

features/netsocket/TCPServer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class TCPServer : public Socket {
4646
*/
4747
template <typename S>
4848
TCPServer(S *stack)
49-
: _pending(1), _accept_sem(0)
49+
: _pending(0), _accept_sem(0)
5050
{
5151
open(stack);
5252
}

features/netsocket/TCPSocket.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include "mbed_assert.h"
2020

2121
TCPSocket::TCPSocket()
22-
: _pending(1), _read_sem(0), _write_sem(0),
22+
: _pending(0), _read_sem(0), _write_sem(0),
2323
_read_in_progress(false), _write_in_progress(false)
2424
{
2525
}

features/netsocket/TCPSocket.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class TCPSocket : public Socket {
4545
*/
4646
template <typename S>
4747
TCPSocket(S *stack)
48-
: _pending(1), _read_sem(0), _write_sem(0),
48+
: _pending(0), _read_sem(0), _write_sem(0),
4949
_read_in_progress(false), _write_in_progress(false)
5050
{
5151
open(stack);

features/netsocket/UDPSocket.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include "mbed_assert.h"
2020

2121
UDPSocket::UDPSocket()
22-
: _pending(1), _read_sem(0), _write_sem(0)
22+
: _pending(0), _read_sem(0), _write_sem(0)
2323
{
2424
}
2525

features/netsocket/UDPSocket.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class UDPSocket : public Socket {
4545
*/
4646
template <typename S>
4747
UDPSocket(S *stack)
48-
: _pending(1), _read_sem(0), _write_sem(0)
48+
: _pending(0), _read_sem(0), _write_sem(0)
4949
{
5050
open(stack);
5151
}

0 commit comments

Comments
 (0)