In DevAcademy, I referred to Lesson 3 – Networking & Sockets, but I couldn't find reference code related to TCP/IP.
Please provide me with this reference code.
In DevAcademy, I referred to Lesson 3 – Networking & Sockets, but I couldn't find reference code related to TCP/IP.
Please provide me with this reference code.
Hi,
I used the macros below in prj.conf for TCP/IP. Are they correct, or should I add or remove any macros?
Hi,
You only need to make a few changes to get lesson 3 exercise 1 to connect to a TCP server instead of UDP.
1. Add CONFIG_NET_TCP=y in prj.conf.
2. Change the two instances of SOCK_DGRAM to SOCK_STREAM.
3. Change IPPROTO_UDP to IPPROTO_TCP in the socket() function.
Make sure to also change the server address and port.
If you get a secure fault when connecting to the server, you might have to set CONFIG_NET_IPV6=n in prj.conf.
Best regards,
Marte