Browse Source

Implement new-style TCP dual-stack in httpserver-netconn, netio, shell, tcpecho and tcpecho_raw

master
Dirk Ziegelmeier 10 years ago
parent
commit
0c2ea887da
  1. 4
      apps/httpserver/httpserver-netconn.c
  2. 4
      apps/netio/netio.c
  3. 4
      apps/shell/shell.c
  4. 4
      apps/tcpecho/tcpecho.c
  5. 4
      apps/tcpecho_raw/tcpecho_raw.c

4
apps/httpserver/httpserver-netconn.c

@ -66,11 +66,11 @@ http_server_netconn_thread(void *arg)
LWIP_UNUSED_ARG(arg);
/* Create a new TCP connection handle */
conn = netconn_new(NETCONN_TCP);
conn = netconn_new(NETCONN_TCP_IPANY);
LWIP_ERROR("http_server: invalid conn", (conn != NULL), return;);
/* Bind to port 80 (HTTP) with default IP address */
netconn_bind(conn, NULL, 80);
netconn_bind(conn, IP_ANY_TYPE, 80);
/* Put the connection into LISTEN state */
netconn_listen(conn);

4
apps/netio/netio.c

@ -43,8 +43,8 @@ void netio_init(void)
{
struct tcp_pcb *pcb;
pcb = tcp_new();
tcp_bind(pcb, IP_ADDR_ANY, 18767);
pcb = tcp_new_ip_type(IPADDR_TYPE_ANY);
tcp_bind(pcb, IP_ANY_TYPE, 18767);
pcb = tcp_listen(pcb);
tcp_accept(pcb, netio_accept);
}

4
apps/shell/shell.c

@ -1168,8 +1168,8 @@ shell_thread(void *arg)
err_t err;
LWIP_UNUSED_ARG(arg);
conn = netconn_new(NETCONN_TCP);
netconn_bind(conn, NULL, 23);
conn = netconn_new(NETCONN_TCP_IPANY);
netconn_bind(conn, IP_ANY_TYPE, 23);
netconn_listen(conn);
while (1) {

4
apps/tcpecho/tcpecho.c

@ -46,10 +46,10 @@ tcpecho_thread(void *arg)
LWIP_UNUSED_ARG(arg);
/* Create a new connection identifier. */
conn = netconn_new(NETCONN_TCP);
conn = netconn_new(NETCONN_TCP_IPANY);
/* Bind connection to well known port number 7. */
netconn_bind(conn, NULL, 7);
netconn_bind(conn, IP_ANY_TYPE, 7);
/* Tell connection to go into listening mode. */
netconn_listen(conn);

4
apps/tcpecho_raw/tcpecho_raw.c

@ -80,12 +80,12 @@ void tcpecho_raw_free(struct tcpecho_raw_state *es);
void
tcpecho_raw_init(void)
{
tcpecho_raw_pcb = tcp_new();
tcpecho_raw_pcb = tcp_new_ip_type(IPADDR_TYPE_ANY);
if (tcpecho_raw_pcb != NULL)
{
err_t err;
err = tcp_bind(tcpecho_raw_pcb, IP_ADDR_ANY, 7);
err = tcp_bind(tcpecho_raw_pcb, IP_ANY_TYPE, 7);
if (err == ERR_OK)
{
tcpecho_raw_pcb = tcp_listen(tcpecho_raw_pcb);

Loading…
Cancel
Save