I'm trying to use one net_if for two ports at once... sorry if this looks dumb.  Using a modified 1.4.1 in raw mode.

I set up two pcb's... I have two different tcp_accept()'s for them. The incoming packets appear to go to the proper places, but the connection is reset after the other one is opened.  I had to open up MEMP_NUM_TCP_PCB_LISTEN to two from one.  Obviously the two _accept()'s set up two _receive()'s.

/**
 * \brief HTTP server init.
 */
void httpd_init(void)
{
    struct tcp_pcb *pcb;
    struct tcp_pcb *pcbHttp;

    pcbHttp = tcp_new();
    tcp_bind(pcbHttp, IP_ADDR_ANY, 80);
    pcbHttp = tcp_listen(pcbHttp);
    tcp_accept(pcbHttp, http_accept);

    pcb = tcp_new();
    tcp_bind(pcb, IP_ADDR_ANY, 502);// was 80 slc
    pcb = tcp_listen(pcb);
    tcp_accept(pcb, modBus_accept);
}

Is this possible?  Is this how it's supposed to be done?  Can I do this without setting up two different net_if's?  Either one works fine with the other commented out.
__
Steve
.

--
Stephen Cowell
Project Manager/Engineer
Plasmability LLC
Office (512) 267-7087
Cell  (512) 632-8593 (best)
www.plasmability.com


_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to