[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Question about adding more ports to listen for
From: |
Kieran Mansley |
Subject: |
Re: [lwip-users] Question about adding more ports to listen for |
Date: |
Thu, 14 Aug 2008 15:58:10 +0100 |
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