mirror of https://github.com/ARMmbed/mbed-os.git
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.pull/3619/head
parent
04a31f3b39
commit
d741c135f4
|
@ -18,7 +18,7 @@
|
|||
#include "mbed.h"
|
||||
|
||||
TCPServer::TCPServer()
|
||||
: _pending(1), _accept_sem(0)
|
||||
: _pending(0), _accept_sem(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ public:
|
|||
*/
|
||||
template <typename S>
|
||||
TCPServer(S *stack)
|
||||
: _pending(1), _accept_sem(0)
|
||||
: _pending(0), _accept_sem(0)
|
||||
{
|
||||
open(stack);
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include "mbed_assert.h"
|
||||
|
||||
TCPSocket::TCPSocket()
|
||||
: _pending(1), _read_sem(0), _write_sem(0),
|
||||
: _pending(0), _read_sem(0), _write_sem(0),
|
||||
_read_in_progress(false), _write_in_progress(false)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ public:
|
|||
*/
|
||||
template <typename S>
|
||||
TCPSocket(S *stack)
|
||||
: _pending(1), _read_sem(0), _write_sem(0),
|
||||
: _pending(0), _read_sem(0), _write_sem(0),
|
||||
_read_in_progress(false), _write_in_progress(false)
|
||||
{
|
||||
open(stack);
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include "mbed_assert.h"
|
||||
|
||||
UDPSocket::UDPSocket()
|
||||
: _pending(1), _read_sem(0), _write_sem(0)
|
||||
: _pending(0), _read_sem(0), _write_sem(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ public:
|
|||
*/
|
||||
template <typename S>
|
||||
UDPSocket(S *stack)
|
||||
: _pending(1), _read_sem(0), _write_sem(0)
|
||||
: _pending(0), _read_sem(0), _write_sem(0)
|
||||
{
|
||||
open(stack);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue