aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2010-08-12 12:21:18 +1000
committerSteve Bennett <steveb@workware.net.au>2010-10-15 11:02:50 +1000
commit0f4cb39eb1ebaf3cc931b450b517a177beb8c05e (patch)
tree288021a44441ecc21e785641c507eff7dbe707d6 /doc
parent2077c587650b0ff0332ceaacece892e38e1c436a (diff)
downloadjimtcl-0f4cb39eb1ebaf3cc931b450b517a177beb8c05e.zip
jimtcl-0f4cb39eb1ebaf3cc931b450b517a177beb8c05e.tar.gz
jimtcl-0f4cb39eb1ebaf3cc931b450b517a177beb8c05e.tar.bz2
Make udp sockets useful
Separate socket types: udp client and udp server Allow client sockets to 'connect' to an address Allow server sockets to 'bind' to an address Add support for 'sendto' and 'recvfrom' Add socket client and server examples Document new udp sockets Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'doc')
-rw-r--r--doc/jim_tcl.txt21
1 files changed, 19 insertions, 2 deletions
diff --git a/doc/jim_tcl.txt b/doc/jim_tcl.txt
index c7adfc2..46484fb 100644
--- a/doc/jim_tcl.txt
+++ b/doc/jim_tcl.txt
@@ -3824,6 +3824,18 @@ aio
+$handle *accept*+::
Server socket only: Accept a connection and return stream
++$handle *sendto* 'str ?hostname:?port'+::
+ Sends the string, *str*, to the given address via the socket using sendto(2).
+ This is intended for udp sockets and may give an error or behave in unintended
+ ways for other handle types.
+ Returns the number of bytes written.
+
++$handle *recvfrom* 'maxlen ?addrvar?'+::
+ Receives a message from the handle via recvfrom(2) and returns it.
+ At most *maxlen* bytes are read.
+ If *addrvar* is specified, the sending address of the message is stored in
+ the named variable in the form 'hostname:port'.
+
eventloop: after, vwait
~~~~~~~~~~~~~~~~~~~~~~~
@@ -3867,8 +3879,13 @@ Various socket types may be created.
+*socket stream.server* '?hostname:?port'+::
A TCP socket server (*hostname* defaults to 0.0.0.0).
-+*socket dgram* 'hostname:port'+::
- A UDP socket client.
++*socket dgram* ?'hostname:port'?+::
+ A UDP socket client. If the address is not specified,
+ the client socket will be unbound and 'sendto' must be used
+ to indicated the destination.
+
++*socket dgram.server* 'hostname:port'+::
+ A UDP socket server.
+*socket pipe*+::
A pipe. Note that unlike all other socket types, this command returns