diff --git a/examples/udp.fs b/examples/udp.fs index 0876104..6459a82 100644 --- a/examples/udp.fs +++ b/examples/udp.fs @@ -33,7 +33,8 @@ variable received-len sizeof(sockaddr_in) received-len ! reader-task start-task ; -: say ( port -- ) +: say ( port -- "host" ) + bl parse s>z gethostbyname ->h_addr outgoing ->addr! outgoing ->port! sockfd tib >in @ + #tib @ >in @ - 0 outgoing sizeof(sockaddr_in) sendto drop @@ -47,9 +48,9 @@ variable received-len sizeof(sockaddr_in) received-len ! ." ------------------" cr ." udp ( open UDP connection on port )" cr ." hear ( wait for messages on udp port and print then )" cr - ." say ( send a message to a port )" cr + ." say ( send a message to a port )" cr cr ." Example: 9999 udp hear ( listener )" cr - ." Example: 9998 udp 9999 say Can you hear me? ( sender )" cr + ." Example: 9998 udp 9999 say localhost Can you hear me? ( sender )" cr ; help quit