Some Insight into the CODE
Connect the Client to the server
(ดูตัวอย่างโปรแกรมในลิ้งค์เอานะครับ)
• เราจะใช้ขั้นตอนต่อไปนี้เพื่อเชื่อมต่อ the UDP client ถึง a server
• ก่อนอื่นเราจะสร้าง a new UDP control block, โดยใช้ udp_new ()
• ต่อไปฉันกำลังผูก the control block กับ the local IP and port, โดยใช้ udp_bind ()
• เชื่อมต่อ the control block เข้ากับ the server IP and port, โดยใช้ udp_connect() ด้วย
• จากนั้นเราจะส่งบาง data ไปยัง the server, และเซ็ต a receive function, ซึ่งจะถูกเรียก, เมื่อ the server ส่งบาง data ไปยัง
the client.