aboutsummaryrefslogtreecommitdiff
path: root/cc3200/telnet
diff options
context:
space:
mode:
authorDaniel Campora2015-05-22 19:53:33 +0200
committerDaniel Campora2015-05-22 19:53:33 +0200
commited56b0baba47e4d0697fdc2d81310a9a2c34c5df (patch)
tree260ea9aa95a23870487e8b0b24df9f7d41a86269 /cc3200/telnet
parent18030bd85d77367162162496ee025b7d98ad3c41 (diff)
cc3200: Finally unlock the full wake on WLAN feature set.
Diffstat (limited to 'cc3200/telnet')
-rw-r--r--cc3200/telnet/telnet.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/cc3200/telnet/telnet.c b/cc3200/telnet/telnet.c
index a910437df..0edc00cdb 100644
--- a/cc3200/telnet/telnet.c
+++ b/cc3200/telnet/telnet.c
@@ -32,6 +32,7 @@
#include "telnet.h"
#include "simplelink.h"
#include "modwlan.h"
+#include "modusocket.h"
#include "debug.h"
#include "mpexception.h"
#include "serverstask.h"
@@ -322,6 +323,9 @@ static bool telnet_create_socket (void) {
// Open a socket for telnet
ASSERT ((telnet_data.sd = sl_Socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) > 0);
if (telnet_data.sd > 0) {
+ // add the socket to the network administration
+ modusocket_socket_add(telnet_data.sd, false);
+
// Enable non-blocking mode
nonBlockingOption.NonblockingEnabled = 1;
ASSERT (sl_SetSockOpt(telnet_data.sd, SOL_SOCKET, SL_SO_NONBLOCKING, &nonBlockingOption, sizeof(nonBlockingOption)) == SL_SOC_OK);
@@ -352,15 +356,18 @@ static void telnet_wait_for_connection (void) {
return;
}
else {
- // close the listening socket, we don't need it anymore
- sl_Close(telnet_data.sd);
-
if (telnet_data.n_sd <= 0) {
// error
telnet_reset();
return;
}
+ // close the listening socket, we don't need it anymore
+ servers_close_socket(&telnet_data.sd);
+
+ // add the new socket to the network administration
+ modusocket_socket_add(telnet_data.n_sd, false);
+
// client connected, so go on
telnet_data.rxWindex = 0;
telnet_data.rxRindex = 0;