aio: Add dgram unix socket support
[jimtcl.git] / examples / unix.dgram.client
blobd9dd8cae3b8b7803c78305acf5bec4cdc967994d
1 # Example of sending from an unconnected socket
3 # Now sending via a connected udp socket
5 set s [socket unix.dgram unix.sock]
6 $s buffering none
8 puts "dgram socket [$s sockname] connected to [$s peername]"
10 foreach i [range 5 10] {
11         # Socket is connected, so can just use puts here
12         # No need to flush because we set 'buffering none' above.
13         $s puts -nonewline "$i * $i"
14         #$s flush
16         # Receive the response - max length of 100
17         puts [$s recvfrom 100]