On Thu, 2008-08-14 at 10:37 -0400, Gary Olson wrote:
> Hi,
> 
>   I would like to add more ports to my echo test that uses lwip in my
> Xilinx board XAPP1026.
> 
> How could I change the code to accept 3 ports instead of just 1 port?
> The original code 

Something like this:

for (i = 0; i < 3; i++) {
/* create new TCP PCB structure */

pcb[i] = tcp_new();

/* bind to specified @port */

err = tcp_bind(pcb[i], IP_ADDR_ANY, port[i]);

/* we do not need any arguments to callback functions */

tcp_arg(pcb[i], NULL);

/* listen for connections */

pcb[i] = tcp_listen(pcb[i]);

/* specify callback to use for incoming connections */

tcp_accept(pcb[i], accept_callback);

}

i.e. Just create multiple pcbs, one for each port.

Kieran



_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to