Free (GPLv2) TCP/IP stack developed by TASS Belgium
Dependents: lpc1768-picotcp-demo ZeroMQ_PicoTCP_Publisher_demo TCPSocket_HelloWorld_PicoTCP Pico_TCP_UDP_Test ... more
PicoTCP. Copyright (c) 2013 TASS Belgium NV.
Released under the GNU General Public License, version 2.
Different licensing models may exist, at the sole discretion of the Copyright holders.
Official homepage: http://www.picotcp.com
Bug tracker: https://github.com/tass-belgium/picotcp/issues
Development steps:
initial integration with mbed RTOSgeneric mbed Ethernet driverhigh performance NXP LPC1768 specific Ethernet driverMulti-threading support for mbed RTOSBerkeley sockets and integration with the New Socket APIFork of the apps running on top of the New Socket APIScheduling optimizations- Debugging/benchmarking/testing
Demo application (measuring TCP sender performance):
Import programlpc1768-picotcp-demo
A PicoTCP demo app testing the ethernet throughput on the lpc1768 mbed board.
Diff: modules/pico_tcp.c
- Revision:
- 48:40fc4462265c
- Parent:
- 45:ca30069e49bb
- Child:
- 49:4b404dd2c97a
- Child:
- 82:93915e13262a
--- a/modules/pico_tcp.c Thu Jul 25 09:36:23 2013 +0000 +++ b/modules/pico_tcp.c Fri Aug 02 07:28:05 2013 +0000 @@ -24,6 +24,7 @@ #define PICO_TCP_RTO_MAX 120000 #define PICO_TCP_IW 2 #define PICO_TCP_SYN_TO 1000 +#define PICO_TCP_ZOMBIE_TO 30000 #define PICO_TCP_MAX_CONNECT_RETRIES 7 @@ -1999,6 +2000,20 @@ } } +void zombie_timer(unsigned long time, void *param) +{ + struct pico_socket_tcp * t = (struct pico_socket_tcp *)param; + if(pico_sockets_find(param) && ((t->sock.state & PICO_SOCKET_STATE_TCP ) == PICO_SOCKET_STATE_TCP_LAST_ACK) ) + { + (t->sock).state &= 0x00FFU; + (t->sock).state |= PICO_SOCKET_STATE_TCP_CLOSED; + (t->sock).state &= 0xFF00U; + (t->sock).state |= PICO_SOCKET_STATE_CLOSED; + tcp_dbg("Deleting zombie socket %p\n",param); + pico_socket_del(&t->sock); + } +} + int pico_tcp_output(struct pico_socket *s, int loop_score) { struct pico_socket_tcp *t = (struct pico_socket_tcp *)s; @@ -2074,6 +2089,8 @@ s->state &= 0x00FFU; s->state |= PICO_SOCKET_STATE_TCP_LAST_ACK; tcp_dbg("TCP> STATE: LAST_ACK.\n"); + // start zombie timer + pico_timer_add(PICO_TCP_ZOMBIE_TO,&zombie_timer,(void *)t); } } return loop_score;