I'm trying to get UDP (with IGMP) and TCP connections working at the same time (same IP address with different ports). Each one works on its own but not together.
My code is almost direct copied from tcpecho_freertos demo in MCUExpresso...
It seems there is some conflict between the two protocols... help appreciated...
tcpip_init(NULL, NULL);
netifapi_netif_add(&netif, &netif_ipaddr, &netif_netmask, &netif_gw, &enet_config, EXAMPLE_NETIF_INIT_FN,
tcpip_input);
netifapi_netif_set_default(&netif);
netifapi_netif_set_up(&netif);
sys_thread_new("tcpecho_thread", tcpecho_thread, NULL, 1024, 3); //<<A
sys_thread_new("udpecho_thread", udpecho_thread, NULL, 3000, 2); //<<B
//...... udpecho_thread...
conn = netconn_new(NETCONN_UDP);
IP4_ADDR(&netif_groupaddr,239,0,0,3); //Multicast pool
netconn_join_leave_group(conn, &netif_groupaddr, IP_ADDR_ANY, NETCONN_JOIN);
netconn_bind(conn, IP_ADDR_ANY, 1234);//7);
... etc..
//...... tcpecho_thread...
conn = netconn_new(NETCONN_TCP);
netconn_bind(conn, IP_ADDR_ANY, 7);
netconn_listen(conn);
... etc..
已解决! 转到解答。