FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [November 2012 Threads]
Note an update to the FreeRTOS+IO code has just been released. You can
download it from the existing FreeRTOS+IO featured demo web page.
The sockets interface is going to be the slowest of the three available lwIP APIs. I know there has been some discussion on the lwIP mailing list about the sockets performance, I would recommend looking in their archive.
Regards.
Ok thanks for the reply.
Maybe someone can show me how to use the netconn api, I want to make a simple tcp server.
I tried this piece of code
struct netconn *conn, *newconn;
err_t err;
/* create a connection structure */
conn = netconn_new(NETCONN_TCP);
/* bind the connection to port 2000 on any local IP address */
netconn_bind(conn, NULL, 7);
printf("Now listening\n");
/* tell the connection to listen for incoming connection requests */
netconn_listen(conn);
/* Grab new connection. */
err = netconn_accept(conn, &newconn);
printf("accepted new connection %p\n", newconn);
/* Process the new connection. */
if (err == ERR_OK)
{
struct netbuf *buf;
void *data;
u16_t len;
while ((err = netconn_recv(newconn, &buf)) == ERR_OK)
{
printf("Received data\n");
do{
netbuf_data(buf, &data, &len);
err = netconn_write(newconn, data, len, NETCONN_COPY);
if (err != ERR_OK)
printf("tcpecho: netconn_write: error \"%s\"\n", lwip_strerr(err));
}while (netbuf_next(buf) >= 0);
netbuf_delete(buf);
}
/* Close connection and discard connection identifier. */
netconn_close(newconn);
netconn_delete(newconn);
}
There is something I don't understand (sorry but I'am not familiar with tcp/ip stack) to initialize the emac driver and the lwip stack, on the example (from freeRtos) we could see :
tcpip_init( lwIPAppsInit, NULL );
Why I can't write
tcpip_init( NULL, NULL );
lwIPAppsInit();
For now this doesn't work, the server start receiving data then nothing and the data rate goes near 0bps.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.