Creating 2 TCP threads
Hi
I am trying to create two TCP threads for my application.these packets are intended to control two VFDs which has two IP addresses(192.168.10.4 and 192.168.10.5) but same port number(502- modbus TCP).I am able to send packets to both the servers simultaneously. the VFDs gives me encoder data embedded in the TCP packets. when i try to capture the encoder data, i found that the data received in the netbuf is getting mixed up . I mean encoder 1 is displayed in encoder2 position in HMI and vice versa. communication to HMI is UDP. i call the udp transmit function in the respective threads itself.i have given seperate names for the netbuf and all the other buffers. i am clearing netbuf in both the threads.looks as if both the threads are trying to write tha same netbuf. how to resolve this issue. is there any problem in doing 2 TCP threads in LWIP. i have given priorities above normal to one thread and normal to the other one. if i comment the netconn_recv of one thread the other thread will work perfectly and i am getting the correct encoder data. whereas if i comment the UDP tranmission to HMI , i can see the data swtching. that's why i assume that the netbuf is getting updated simultaneously. please help. i am stuck with this issue for the last few days
the relevant portions of the code is attached
thanks in advance
RMG
