Free (GPLv2) TCP/IP stack developed by TASS Belgium
Fork of PicoTCP by
Revision 23:884f327c3647, committed 2013-06-10
- Comitter:
- daniele
- Date:
- Mon Jun 10 08:01:01 2013 +0000
- Parent:
- 22:6d0d7ab4aa6d
- Child:
- 24:8bff2b51ea3b
- Commit message:
- Fixed bug in select function
Changed in this revision
--- a/Socket/bsd/proxy_endpoint.cpp Sun Jun 09 16:26:33 2013 +0000 +++ b/Socket/bsd/proxy_endpoint.cpp Mon Jun 10 08:01:01 2013 +0000 @@ -157,8 +157,8 @@ ep->pending = TOK_POLL; ep->timeout = timeout->tv_sec * 1000 + timeout->tv_usec / 1000; ep->events = PICO_SOCK_EV_ERR; - ep->events = PICO_SOCK_EV_FIN; - ep->events = PICO_SOCK_EV_CLOSE; + ep->events |= PICO_SOCK_EV_FIN; + ep->events |= PICO_SOCK_EV_CLOSE; ep->events |= PICO_SOCK_EV_CONN; if (read) { ep->events |= PICO_SOCK_EV_RD;
--- a/Socket/bsd/stack_endpoint.cpp Sun Jun 09 16:26:33 2013 +0000 +++ b/Socket/bsd/stack_endpoint.cpp Mon Jun 10 08:01:01 2013 +0000 @@ -435,21 +435,19 @@ (void)arg; int ret = 0; while(1) { + ret = stack_parse_requests(); pico_stack_tick(); - Thread::wait(1); - ret = stack_parse_requests(); - if (ret > 0) - pico_stack_tick(); - else - Thread::wait(1); + Thread::wait(0); } } void picotcp_start(void) { + Ticker *picotcpTicker = new Ticker(); if (serverThread == NULL) { printf (" *** PicoTCP initialized *** \n"); serverThread = new Thread(pico_wrapper_loop); serverThread->set_priority(osPriorityIdle); + //picotcpTicker->attach(&pico_stack_tick, 0.001); } }
--- a/include/pico_socket.h Sun Jun 09 16:26:33 2013 +0000 +++ b/include/pico_socket.h Mon Jun 10 08:01:01 2013 +0000 @@ -11,7 +11,7 @@ #include "pico_protocol.h" //#define PICO_DEFAULT_SOCKETQ (128 * 1024) -#define PICO_DEFAULT_SOCKETQ (16 * 1024) +#define PICO_DEFAULT_SOCKETQ (8 * 1024) #define PICO_SHUT_RD 1
--- a/stack/pico_stack.c Sun Jun 09 16:26:33 2013 +0000 +++ b/stack/pico_stack.c Mon Jun 10 08:01:01 2013 +0000 @@ -488,7 +488,7 @@ #define PROTO_DEF_SCORE 32 #define PROTO_MIN_SCORE 32 #define PROTO_MAX_SCORE 128 -#define PROTO_LAT_IND 3 /* latecy indication 0-3 (lower is better latency performance), x1, x2, x4, x8 */ +#define PROTO_LAT_IND 1 /* latecy indication 0-3 (lower is better latency performance), x1, x2, x4, x8 */ #define PROTO_MAX_LOOP (PROTO_MAX_SCORE<<PROTO_LAT_IND) /* max global loop score, so per tick */ static int calc_score(int *score, int *index, int avg[][PROTO_DEF_AVG_NR], int *ret)