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
Christopher Haster 2017-01-20 07:55:42 -06:00
parent 04a31f3b39
commit d741c135f4
6 changed files with 6 additions and 6 deletions

View File

@ -18,7 +18,7 @@
#include "mbed.h"
TCPServer::TCPServer()
: _pending(1), _accept_sem(0)
: _pending(0), _accept_sem(0)
{
}

View File

@ -46,7 +46,7 @@ public:
*/
template <typename S>
TCPServer(S *stack)
: _pending(1), _accept_sem(0)
: _pending(0), _accept_sem(0)
{
open(stack);
}

View File

@ -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)
{
}

View File

@ -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);

View File

@ -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)
{
}

View File

@ -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);
}