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.
Revision 64:0225b609335e, committed 2013-09-17
- Comitter:
- tass
- Date:
- Tue Sep 17 07:25:24 2013 +0000
- Parent:
- 62:357cc2460285
- Child:
- 65:8cdaaa1df01d
- Commit message:
- Issue #27. No more memory leaks from dns and udp.
Changed in this revision
--- a/Socket/bsd/stack_endpoint.cpp Mon Sep 16 12:07:35 2013 +0000 +++ b/Socket/bsd/stack_endpoint.cpp Tue Sep 17 07:25:24 2013 +0000 @@ -539,7 +539,7 @@ // send the result back ((Queue<void,1> *)arg)->put((void *)ip); fail: - if(ip) free(ip); + if(ip) pico_free(ip); } // dns get host @@ -551,9 +551,11 @@ if(!dnsResult) return NULL; - + PicoTcpLock->lock(); pico_dns_client_getaddr(name,dns_cb,dnsResult); - + PicoTcpLock->unlock(); + picotcp_async_interrupt(NULL); + osEvent evt = dnsResult->get(7000);// 7 seconds timeout if (evt.status == osEventMessage){ ip = (char *)evt.value.p;
--- a/modules/pico_dns_client.c Mon Sep 16 12:07:35 2013 +0000 +++ b/modules/pico_dns_client.c Tue Sep 17 07:25:24 2013 +0000 @@ -255,7 +255,7 @@ struct pico_dns_query test = {0}, *found = NULL; test.id = id; - found = pico_tree_findKey(&NSTable, &test); + found = pico_tree_findKey(&DNSTable, &test); if (!found) return -1;
--- a/stack/pico_socket.c Mon Sep 16 12:07:35 2013 +0000 +++ b/stack/pico_socket.c Tue Sep 17 07:25:24 2013 +0000 @@ -584,10 +584,32 @@ return 0; } +static void socket_clean_queues(struct pico_socket *sock) +{ + struct pico_frame * f_in = pico_dequeue(&sock->q_in); + struct pico_frame * f_out = pico_dequeue(&sock->q_out); + while(f_in || f_out) + { + if(f_in) + { + pico_frame_discard(f_in); + f_in = pico_dequeue(&sock->q_in); + } + + if(f_out) + { + pico_frame_discard(f_out); + f_out = pico_dequeue(&sock->q_out); + } + + } +} + static void socket_garbage_collect(unsigned long now, void *arg) { struct pico_socket *s = (struct pico_socket *) arg; IGNORE_PARAMETER(now); + socket_clean_queues(s); pico_free(s); }