µTasker Forum
µTasker Forum => NXPTM M522XX, KINETIS and i.MX RT => Topic started by: neil on March 16, 2022, 03:52:46 PM
-
HI Mark,
Hope you are keeping well :)
In my project I have to include a UDP and TCP server . I use the TCP client often, but never as a server. Is there any examples for both UDP and TCP server ?
Best Regards
Neil
-
Hi Neil
Use the HTTP server as reference for a TCP server using simple socket mode.
Use the TELNET server as reference for a TCP server using buffer socket mode.
The only difference between a UDP client and a UDP server is that the USB server is set to listening mode rather than actively connecting to a remote UDP server. The UDP callbacks are otherwise identical. As a server you will generally be listening for data which can arrive at any time and when it does you will receive an appropriate callback event to handle the data - the server will generally make a not of the client's details (eg. its IP address and source port) and can subsequently send data to it in the same way as a client does.
Regards
Mark
-
Hi Mark,
Many thanks for the reply. Is there any documentation on this?
Best Regards
Neil
-
Neil
For Telnet there is:
https://www.utasker.com/docs/uTasker/uTaskerTELNET.PDF
(although not a complete description)
For TCP there is:
https://www.utasker.com/forum/index.php?topic=25.0
(which also has examples from Telnet configuration and use)
UDP is so simple it is best to experiment with a simple listener.
Regards
Mark