7 .HLL 'Tcl', 'tcl_group'
11 .param pmc argv :slurpy
15 if argc < 2 goto bad_args
16 if argc > 2 goto bad_args
23 load_bytecode 'library/tcpstream.pir'
25 stream = new 'TCPStream'
26 stream.'connect'(host, port)
28 .local pmc channels, next_channel_id
29 channels = get_root_global ['_tcl'], 'channels'
30 next_channel_id = get_root_global ['_tcl'], 'next_channel_id'
32 .local string channel_id
34 # get a new file channel name
39 channels[channel_id] = stream
44 tcl_error 'wrong # args: should be "socket ?-myaddr addr? ?-myport myport? ?-async? host port" or "socket -server command ?-myaddr addr? port"'
52 # vim: expandtab shiftwidth=4 ft=pir: