Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199801_2.adf » Regulars2 » StarInfo/Fletcher/!Setup/Files/Disc1/Program/NetGame/!NetGame/Help/SocketLib

StarInfo/Fletcher/!Setup/Files/Disc1/Program/NetGame/!NetGame/Help/SocketLib

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199801_2.adf » Regulars2
Filename: StarInfo/Fletcher/!Setup/Files/Disc1/Program/NetGame/!NetGame/Help/SocketLib
Read OK:
File size: 42D0 bytes
Load address: 0000
Exec address: 0000
File contents
HELP(�����,����$DIR$���G���u��k�!Root�G������kvinfo(	G�����?r�PROC�G�����?r�FNDATA�SocketLib routines
#Parent StrongHelp:!Menu
Socket specific :
#Indent 2
#Table Columns 3
<PROCinitsockets>
<PROCclosesockets>
<FNsocket_createinet>
<PROCsocket_close>
<PROCsocket_listen>
<FNsocket_findlisten>
<FNsocket_accept>
<FNsocket_connect>
<FNsocket_noblockconnect>
<FNsocket_ready>
<FNsocket_connected>
<PROCsocket_makebuffered>
<PROCsocket_makelinger>
<PROCsocket_makereusable>
<FNsocket_inbuffer>
<FNsocket_eof>
<FNsocket_readdata>
<FNsocket_readline>
<PROCsocket_senddata>
<PROCsocket_sendline>
<FNsocket_getpeername>
#EndTable
#Indent

Non-socket specific :
#Indent 2
#Table Columns 2
<FNinet_gethostbyname>
<FNinet_gethostbyaddr>
<FNinet_getservbyname>
<FNinet_getservbyport>
<FNinet_decodeerror>
<FNinet_createservmenu>
<FNinet_mtresolver>
<FNinet_startmtgethostbyname>
<FNinet_startmtgethostbyaddr>
<FNinet_checkmtquery>
<FNinet_mtgethostbyname>
<FNinet_mtgethostbyaddr>
<PROCinet_killmtquery>
#EndTable
#Indent

Buffer handling :
#Indent 2
#Table Columns 2
<FNbuffer_getword>
<FNbuffer_getrest>
#EndTable
#Indent

Logging (<SysLog=>SWI:SysLog_>) :
#Indent 2
#Table Columns 3
<PROCsyslog>
<FNlog_opensession>
<PROClog_closesession>
<PROClog_session>
<PROClog_indent>
<PROClog_outdent>
<PROClog_data>
#EndTable
#Indent

<Information=>info> on SocketLib
DATAvSocketLib help
#Align Centre
{fh3}JFShared SocketLib v1.09{f}
#Align Left

The Socket Library is a Basic Library file which provides an interface to the <Internet=>Internet:!Root> Sockets SWI calls. In conjunction with the <WimpLib=>WimpLib:!Root> and JFShared skeleton application this provides a very simple way of creating applications which can talk to ports across the internet, or an intranet. This help file details the routines provided in SocketLib.

The Socket Library is referenced by \<SocketLibrary$File> and should be loaded with :
{fCode}LIBRARY "\<SocketLibrary$File>":PROCinitsockets{f}

The JFShared application is � <Justin Fletcher=>Filetypes:Authors_JustinFletcher>, 1997 and is released into the Public Domain with the same restrictions as subsist in most PD software. This includes the fact that when distributed the entire application must remain intact.DIR$��
F�������initsockets�
G���U�KTclosesockets�G���-�?rsocket_�G����?r0inet_HG����Na�syslog�G���ƿ?r�log_DATA�PROCinitsockets
#Parent !Root
Initialise the sockets library variables

Call this routine at the start of any program that uses the SocketsLib file.
DATAPROCclosesockets
#Parent !Root
Shutsdown the Sockets library.

You must call this routine at the end of any program which uses the library. It will close all the sockets currently open and release any memory claimed, as well as removing all multitasking lookups.
DIR$�F����E�mclose(
F�������listen�F���m��!makebuffered�F���N
��makelinger�F����B
�Qmakereusable@F���DL��senddata,F������sendlineDATAmPROCsocket_close(socket)
#Parent !Root
=>	{/}socket{/}	handle of socket

Closes a sockets connection.DATA�PROCsocket_listen(socket,ip,port)
#Parent !Root
=>	/socket/	handle of socket as given by <FNsocket_createinet>
	/ip/		address of host to accept connections from (usually 0)
	/port/		port number to listen on

Listens for connections on a specific socket. An error will occur if the specified port is already bound to another socket. Use <FNsocket_findlisten> if you wish to be allocated a socket in a range.DATA!PROCsocket_makebuffered(socket)
#Parent !Root
=>	/socket/	handle of socket as given by <FNsocket_createinet>

Allocates a buffer for the socket so that calls to <FNsocket_readline> can be used. Otherwise you'll have to just use <FNsocket_readdata> passing your own memory pointer.
DATA�PROCsocket_makelinger(socket,time)
#Parent !Root
=>	/socket/	handle of socket as given by <FNsocket_createinet>
	/time/		time to linger for in seconds, or 0 to disable

Ensures that the socket will remain valid so that data can be read on close.
DATAQPROCsocket_makereusable(socket,flag)
#Parent !Root
=>	/socket/	handle of socket as given by <FNsocket_createinet>
	/flag/		TRUE to allow the address to be re-used

When you close a socket it usually waits for a time before allowing another socket to be created on the same port. By making the socket reusable this will not occur.DATA�PROCsocket_senddata(socket,block,length)
#Parent !Root
=>	/socket/	handle of socket as given by <FNsocket_createinet>
	/block/		pointer to the data to send
	/length/	length of data to send

Sends a block of memory to a socket.
DATA�PROCsocket_sendline(socket,line$)
#Parent !Root
=>	{/}socket{/}	handle of socket as given by <FNsocket_createinet>
	{/}line${/}		line to send

Sends a line to a socket, LF (&10) terminated.
DIR$00$G�����JT$killmtqueryDATA$PROCinet_killmtquery(handle)
#Parent !Root
=>	{/}handle{/}	handle returned by one of the FNinet_start... calls

Destroys a multi-tasking lookup. Use this if you don't care anymore what the address is. This is performed automatically after reading the answer with FNinet_mtgethostby...DATA�PROCsyslog(level,text$)
#Parent !Root
=>	{/}level{/}	<priority=>SWI:SysLog_priorities>
	{/}text${/}	text to log

Log a line to the main log for this application.
DIR$���G���Qga�closesession8G�����a�sessionG�����a�indent�G���:�a�outdenthG���n6aKdataDATA�PROClog_closesession(session)
#Parent !Root
=>	{/}session{/}	session handle returned from <FNlog_opensession>

Closes a session log.
DATA�PROClog_session(session,level,text)
#Parent !Root
=>	{/}session{/}	session handle returned from <FNlog_opensession>
	{/}level{/}	<priority=>SWI:SysLog_priorities>
	{/}text${/}	text to log

Log a line to a session log.
DATA�PROClog_indent(log)
#Parent !Root
=>	{/}log{/}	session handle returned from <FNlog_opensession>, or -1 for default

Indents subsequent output to the log file.
DATA�PROClog_outdent(log)
#Parent !Root
=>	{/}log{/}	session handle returned from <FNlog_opensession>, or -1 for default

Removes one indent from the log file.
DATAKPROClog_data(log,level,data,length,start)
#Parent !Root
=>	{/}log{/}	session handle returned from <FNlog_opensession>, or -1 for default
	{/}level{/}	<priority=>SWI:SysLog_priorities>
	{/}data{/}	pointer to the data
	{/}length{/}	length of data
	{/}start{/}	offset of the start of the data when output

Dumps a data block.
DIR$��@G����?r�socket_�-G���)�?rLbuffer_@4G���t�?r�inet_BG�����?r0log_DIR$���F������connectF�����findlisten�F���\�)accept� F���Gb
�inbuffer�!G������1
eof�"F���;�
��readdata�$F���,
�ireadline$'F���a���getpeername(G����"�kcreateinet)G���:�HTnoblockconnect+G�����HTereadyx,G�����k
connectedDATAFNsocket_connect(socket,ip,port)
#Parent !Root
=>	{/}socket{/}	handle of socket as given by <FNsocket_createinet>
	/ip/		address of host to connect to
	/port/		port number to connect to
<=	TRUE if connection was made successfully

Initiates a connection to a socket.
DATA�FNsocket_findlisten(socket,ip,port)
#Parent !Root
=>	/socket/	handle of socket as given by <FNsocket_createinet>
	/ip/		address of host to accept connections from (usually 0)
	/port/		port number to listen on
	/limit/		limit for search (ie 1 for port => (port +1))
<=	number of port listening on, or -1 if not possible

Listens for connections on a socket, moving to the next if the specified port is already taken.
DATA)FNsocket_accept(socket)
#Parent !Root
=>	/socket/	handle of socket as given by <FNsocket_createinet>
<=	new /socket/ handle, or -1 if no connection waiting.

Accepts a connection currently waiting. The returned socket is the new connection, whilst the original socket continues listening.
DATAFNsocket_inbuffer(socket)
#Parent !Root
=>	/socket/	handle of socket as given by <FNsocket_createinet>
<=	amount of data waiting

Reads the amount of data waiting to be read on the socket. Use <FNsocket_readdata> or <FNsocket_readline> to read the data.DATA
FNsocket_eof(socket)
#Parent !Root
=>	/socket/	handle of socket as given by <FNsocket_createinet>
<=	TRUE if the other end has closed the socket

Reads the EOF condition on a socket.

Note: You are still required to close the socket with <PROCsocket_close>.
DATA�FNsocket_readdata(socket,start)
#Parent !Root
=>	/socket/	handle of socket as given by <FNsocket_createinet>
	/start/		if unbuffered, this should be a pointer to a block of memory to read the data into
<=	length of data read
	/start/		if buffered, this will contain the pointer to the start of the buffer

Reads the data currently waiting into the buffer specified. If you are using unbuffered sockets then you will need 2k to be allocated to the buffer.
DATAiFNsocket_readline(socket,start)
#Parent !Root
=>	/socket/	handle of socket as given by <FNsocket_createinet>
<=	length of line read
	/start/		this will contain the pointer to the start of the buffer, or -1 if no line complete has been received

Reads the data from the socket into the buffer and returns a pointer to a 'line' of text, returning the length. The line will be in a temporary buffer which is valid until the next call to FNsocket_readline. This call is usually used in conjunction with the <FNbuffer_getword> and <FNbuffer_getrest> calls.

Note: You cannot use this call with unbuffered sockets.
DATA�FNsocket_getpeername(socket)
#Parent !Root
=>	/socket/	handle of socket as given by <FNsocket_createinet>
<=	name of host to which socket is connected

Returns the name of the host at the other end of the socket.DATAFNsocket_createinet
#Parent !Root
<=	/socket/	handle of new socket, or -1 if couldn't create it

Creates a socket for internet use.

Note: The handle of the socket is NOT that used directly by the Socket SWIs. To read that you should use {/}sock%(socket)!0{/}.DATAFNsocket_noblockconnect(socket,ip,port)
#Parent !Root
=>	{/}socket{/}	handle of socket as given by <FNsocket_createinet>
	/ip/		address of host to connect to
	/port/		port number to connect to
<=	TRUE if connection was made successfully,
	FALSE if connection was unsuccessful,
	1 if connection is still being made

Initiates a connection to a socket. If 1 is returned, you should call <FNsocket_ready>({/}socket{/},FALSE) repeatedly until the connection is made or fails (or until you decide to time out).
DATAeFNsocket_ready(socket,read)
#Parent !Root
=>	{/}socket{/}	handle of socket as given by <FNsocket_createinet>
	{/}read{/}	TRUE means test if socket is ready to be read,
	 		FALSE means test if ready to write
<=	1 if the socket is ready for use, 0 if not; -1 on error

Discovers whether a socket is ready to use. Used after <FNsocket_noblockconnect>.
DATA
FNsocket_connected(socket)
#Parent !Root
=>	{/}socket{/}	handle of socket as given by <FNsocket_createinet>
<=	TRUE if connected, FALSE if not yet, error number if failed

Discovers whether a socket is connected or not. Used after <FNsocket_noblockconnect>.
DIR$LL�-F����
��getword�1F�����
��getrestDATA�FNbuffer_getword(start,len,ptr)
#Parent !Root
=>	/start/	start of data
	/len/	length of data in block
	/ptr/	offset to first byte to read
<=	word read, or NULL if none.
	/ptr/	updated

Reads a textual word from the block specified, skipping leading spaces.

Click <here=>.example> for an example.
#Subpage example
FNbuffer_getword examples
This is just a simple example to wait for HELO \<hostname> as might be done by an SMTP server.
#fCode
REPEAT
 len=FNsocket_readline(mainsocket%,start)
 IF len>0 THEN
  ptr=0
  a$=FNbuffer_getword(start,len,ptr)
  IF a$="HELO" THEN
   a$=FNbuffer_getword(start,len,ptr)
   IF a$\<>FNsocket_getpeername(mainsocket%) THEN
    {f;/}... they gave us the wrong host name{/;fCode}
   ELSE
    {f;/}... they gave us the right host name{/;fCode}
   ENDIF
  ELSE
   {f;/}... do something else 'cos it's not HELO{/;fCode}
  ENDIF
 ENDIF
UNTIL FNsocket_eof(mainsocket%)
#f

Note: I haven't tested this, it's is only for information
DATA�FNbuffer_getrest(start,len,ptr)
#Parent !Root
=>	/start/	start of data
	/len/	length of data in block
	/ptr/	offset to first byte to read
<=	line read, or NULL if none.
	/ptr/	updated

Reads the rest of the line from the buffer, stopping when a LF (&0A) or CR (&0D) is encountered.

Click <here=>.example> for an example.
#Subpage example
FNbuffer_getrest examples
This is just a simple example to throw whatever comes from the port at the screen.

#fCode
REPEAT
 len=FNsocket_readline(mainsocket%,start)
 IF len>0 THEN
  a$=FNbuffer_getrest(start,len,ptr)
  PRINT a$
 ENDIF
UNTIL FNsocket_eof(mainsocket%)
#f

Note: I haven't tested this, it's is only for information
DIR$��46F���]��Ygetservbyname�7F���u��getservbyport�8F���ʌ��gethostbyname9F���O��gethostbyaddr�9G���%RIT
createservmenu�:G����IT~mtresolver4<G����OJT0startmtgethostbyaddrd=G����_JT*startmtgethostbyname�>G�����JTFcheckmtquery�?G����JT�mtgethostbyname�@G���o�JT�mtgethostbyaddr�AG������k�decodeerrorDATAYFNinet_getservbyname(name$,proto$)
#Parent !Root
=>	{/}name${/}	name of service
	{/}proto${/}	protocol to use
<=	number of port

Reads the port number which provides a particular service from the Services file in the !Internet resource. The only protocols which have any entries are tcp and udp.

Note: This can take time under FreeNet.
DATA�FNinet_getservbyport(port,proto$)
#Parent !Root
=>	/port/		port number
	{/}proto${/}	protocol to use
<=	name of service

Reads the name of the service which is provided on a particular port.

Note: This can take time under FreeNet.
DATA�FNinet_gethostbyname(host$)
#Parent !Root
=>	{/}host${/}	name of host
<=	address of host

Looks up the address of a particular host.
DATA�FNinet_gethostbyaddr(address)
#Parent !Root
=>	/address/	address of host
<=	name of host

Looks up the name of a host from it's address.
DATA
FNinet_createservmenu(name$,proto$)
#Parent !Root
=>	{/}name${/}	name of service to tick, or null for none
	{/}proto${/}	protocol to use, or null for default
<=	pointer to menu structure

Creates a menu structure for all the services, ticking the selected one.
DATA~FNinet_mtresolver
#Parent !Root
<=	TRUE if there is a multitasking resolver present

Checks for the presence of a multitasking resolver. If this does not return TRUE you should NOT call the following routines :
#Indent 2
<FNinet_startmtgethostbyname>
<FNinet_startmtgethostbyaddr>
<FNinet_checkmtquery>
<FNinet_killmtquery>
<FNinet_mtgethostbyname>
<FNinet_mtgethostbyaddr>
DATA0FNinet_startmtgethostbyaddr(addr)
#Parent !Root
=>	{/}addr{/}	address to resolver
<=	handle of lookup, or 0 if call failed

Starts a multitasking lookup of a host by it's address. Use <FNinet_checkmtquery> to find the current state of the lookup, and <FNinet_mtgethostbyaddr> to read the result.
DATA*FNinet_startmtgethostbyname(host$)
#Parent !Root
=>	{/}host${/}	host to lookup
<=	handle of lookup, or 0 if call failed

Starts a multitasking lookup of a host by it's name. Use <FNinet_checkmtquery> to find the current state of the lookup, and <FNinet_mtgethostbyname> to read the result.
DATAFFNinet_checkmtquery(handle)
#Parent !Root
=>	{/}handle{/}	handle returned by one of the FNinet_start... calls
<=	TRUE if lookup has succeeded,
	FALSE if lookup has failed,
	1 is lookup is still going

Checks the state of a multitasking lookup started by <FNinet_startmtgethostbyname> or <FNinet_startmtgethostbyaddr>.
DATA�FNinet_mtgethostbyname(handle)
#Parent !Root
=>	{/}handle{/}	handle returned by <FNinet_startmtgethostbyname>
<=	IP of host if found, 0 otherwise

Reads the result of a multitasking name lookup.
DATA�FNinet_mtgethostbyaddr(handle)
#Parent !Root
=>	{/}handle{/}	handle returned by <FNinet_startmtgethostbyaddr>
<=	name of host if found, or null if not found

Reads the result of a multitasking address lookup.
DATA�FNinet_decodeerror(error)
#Parent !Root
=>	{/}error{/}	error number
<=	textual error message

Reads the textual version of an error message.
DIR$00HBG�����a�opensessionDATA�FNlog_opensession(level)
#Parent !Root
=>	{/}level{/}	<priority=>SWI:SysLog_priorities>
<=	session handle

Opens a session log.
00000000  48 45 4c 50 28 00 00 00  cb 00 00 00 ff ff ff ff  |HELP(...........|
00000010  2c 00 00 00 00 fd ff ff  00 00 00 00 80 00 00 00  |,...............|
00000020  00 01 00 00 00 00 00 00  24 00 00 00 44 49 52 24  |........$...DIR$|
00000030  88 00 00 00 88 00 00 00  b4 00 00 00 47 fd ff ff  |............G...|
00000040  75 bc d8 6b fa 04 00 00  13 00 00 00 00 00 00 00  |u..k............|
00000050  21 52 6f 6f 74 00 00 00  b0 05 00 00 47 fd ff ff  |!Root.......G...|
00000060  ef d4 d8 6b 76 03 00 00  13 00 00 00 00 00 00 00  |...kv...........|
00000070  69 6e 66 6f 00 00 00 00  28 09 00 00 47 fd ff ff  |info....(...G...|
00000080  b5 bb 3f 72 d8 00 00 00  13 01 00 00 00 00 00 00  |..?r............|
00000090  50 52 4f 43 00 00 00 00  b4 1a 00 00 47 fd ff ff  |PROC........G...|
000000a0  a8 c0 3f 72 8c 00 00 00  13 01 00 00 00 00 00 00  |..?r............|
000000b0  46 4e 00 00 44 41 54 41  fa 04 00 00 53 6f 63 6b  |FN..DATA....Sock|
000000c0  65 74 4c 69 62 20 72 6f  75 74 69 6e 65 73 0a 23  |etLib routines.#|
000000d0  50 61 72 65 6e 74 20 53  74 72 6f 6e 67 48 65 6c  |Parent StrongHel|
000000e0  70 3a 21 4d 65 6e 75 0a  53 6f 63 6b 65 74 20 73  |p:!Menu.Socket s|
000000f0  70 65 63 69 66 69 63 20  3a 0a 23 49 6e 64 65 6e  |pecific :.#Inden|
00000100  74 20 32 0a 23 54 61 62  6c 65 20 43 6f 6c 75 6d  |t 2.#Table Colum|
00000110  6e 73 20 33 0a 3c 50 52  4f 43 69 6e 69 74 73 6f  |ns 3.<PROCinitso|
00000120  63 6b 65 74 73 3e 0a 3c  50 52 4f 43 63 6c 6f 73  |ckets>.<PROCclos|
00000130  65 73 6f 63 6b 65 74 73  3e 0a 3c 46 4e 73 6f 63  |esockets>.<FNsoc|
00000140  6b 65 74 5f 63 72 65 61  74 65 69 6e 65 74 3e 0a  |ket_createinet>.|
00000150  3c 50 52 4f 43 73 6f 63  6b 65 74 5f 63 6c 6f 73  |<PROCsocket_clos|
00000160  65 3e 0a 3c 50 52 4f 43  73 6f 63 6b 65 74 5f 6c  |e>.<PROCsocket_l|
00000170  69 73 74 65 6e 3e 0a 3c  46 4e 73 6f 63 6b 65 74  |isten>.<FNsocket|
00000180  5f 66 69 6e 64 6c 69 73  74 65 6e 3e 0a 3c 46 4e  |_findlisten>.<FN|
00000190  73 6f 63 6b 65 74 5f 61  63 63 65 70 74 3e 0a 3c  |socket_accept>.<|
000001a0  46 4e 73 6f 63 6b 65 74  5f 63 6f 6e 6e 65 63 74  |FNsocket_connect|
000001b0  3e 0a 3c 46 4e 73 6f 63  6b 65 74 5f 6e 6f 62 6c  |>.<FNsocket_nobl|
000001c0  6f 63 6b 63 6f 6e 6e 65  63 74 3e 0a 3c 46 4e 73  |ockconnect>.<FNs|
000001d0  6f 63 6b 65 74 5f 72 65  61 64 79 3e 0a 3c 46 4e  |ocket_ready>.<FN|
000001e0  73 6f 63 6b 65 74 5f 63  6f 6e 6e 65 63 74 65 64  |socket_connected|
000001f0  3e 0a 3c 50 52 4f 43 73  6f 63 6b 65 74 5f 6d 61  |>.<PROCsocket_ma|
00000200  6b 65 62 75 66 66 65 72  65 64 3e 0a 3c 50 52 4f  |kebuffered>.<PRO|
00000210  43 73 6f 63 6b 65 74 5f  6d 61 6b 65 6c 69 6e 67  |Csocket_makeling|
00000220  65 72 3e 0a 3c 50 52 4f  43 73 6f 63 6b 65 74 5f  |er>.<PROCsocket_|
00000230  6d 61 6b 65 72 65 75 73  61 62 6c 65 3e 0a 3c 46  |makereusable>.<F|
00000240  4e 73 6f 63 6b 65 74 5f  69 6e 62 75 66 66 65 72  |Nsocket_inbuffer|
00000250  3e 0a 3c 46 4e 73 6f 63  6b 65 74 5f 65 6f 66 3e  |>.<FNsocket_eof>|
00000260  0a 3c 46 4e 73 6f 63 6b  65 74 5f 72 65 61 64 64  |.<FNsocket_readd|
00000270  61 74 61 3e 0a 3c 46 4e  73 6f 63 6b 65 74 5f 72  |ata>.<FNsocket_r|
00000280  65 61 64 6c 69 6e 65 3e  0a 3c 50 52 4f 43 73 6f  |eadline>.<PROCso|
00000290  63 6b 65 74 5f 73 65 6e  64 64 61 74 61 3e 0a 3c  |cket_senddata>.<|
000002a0  50 52 4f 43 73 6f 63 6b  65 74 5f 73 65 6e 64 6c  |PROCsocket_sendl|
000002b0  69 6e 65 3e 0a 3c 46 4e  73 6f 63 6b 65 74 5f 67  |ine>.<FNsocket_g|
000002c0  65 74 70 65 65 72 6e 61  6d 65 3e 0a 23 45 6e 64  |etpeername>.#End|
000002d0  54 61 62 6c 65 0a 23 49  6e 64 65 6e 74 0a 0a 4e  |Table.#Indent..N|
000002e0  6f 6e 2d 73 6f 63 6b 65  74 20 73 70 65 63 69 66  |on-socket specif|
000002f0  69 63 20 3a 0a 23 49 6e  64 65 6e 74 20 32 0a 23  |ic :.#Indent 2.#|
00000300  54 61 62 6c 65 20 43 6f  6c 75 6d 6e 73 20 32 0a  |Table Columns 2.|
00000310  3c 46 4e 69 6e 65 74 5f  67 65 74 68 6f 73 74 62  |<FNinet_gethostb|
00000320  79 6e 61 6d 65 3e 0a 3c  46 4e 69 6e 65 74 5f 67  |yname>.<FNinet_g|
00000330  65 74 68 6f 73 74 62 79  61 64 64 72 3e 0a 3c 46  |ethostbyaddr>.<F|
00000340  4e 69 6e 65 74 5f 67 65  74 73 65 72 76 62 79 6e  |Ninet_getservbyn|
00000350  61 6d 65 3e 0a 3c 46 4e  69 6e 65 74 5f 67 65 74  |ame>.<FNinet_get|
00000360  73 65 72 76 62 79 70 6f  72 74 3e 0a 3c 46 4e 69  |servbyport>.<FNi|
00000370  6e 65 74 5f 64 65 63 6f  64 65 65 72 72 6f 72 3e  |net_decodeerror>|
00000380  0a 3c 46 4e 69 6e 65 74  5f 63 72 65 61 74 65 73  |.<FNinet_creates|
00000390  65 72 76 6d 65 6e 75 3e  0a 3c 46 4e 69 6e 65 74  |ervmenu>.<FNinet|
000003a0  5f 6d 74 72 65 73 6f 6c  76 65 72 3e 0a 3c 46 4e  |_mtresolver>.<FN|
000003b0  69 6e 65 74 5f 73 74 61  72 74 6d 74 67 65 74 68  |inet_startmtgeth|
000003c0  6f 73 74 62 79 6e 61 6d  65 3e 0a 3c 46 4e 69 6e  |ostbyname>.<FNin|
000003d0  65 74 5f 73 74 61 72 74  6d 74 67 65 74 68 6f 73  |et_startmtgethos|
000003e0  74 62 79 61 64 64 72 3e  0a 3c 46 4e 69 6e 65 74  |tbyaddr>.<FNinet|
000003f0  5f 63 68 65 63 6b 6d 74  71 75 65 72 79 3e 0a 3c  |_checkmtquery>.<|
00000400  46 4e 69 6e 65 74 5f 6d  74 67 65 74 68 6f 73 74  |FNinet_mtgethost|
00000410  62 79 6e 61 6d 65 3e 0a  3c 46 4e 69 6e 65 74 5f  |byname>.<FNinet_|
00000420  6d 74 67 65 74 68 6f 73  74 62 79 61 64 64 72 3e  |mtgethostbyaddr>|
00000430  0a 3c 50 52 4f 43 69 6e  65 74 5f 6b 69 6c 6c 6d  |.<PROCinet_killm|
00000440  74 71 75 65 72 79 3e 0a  23 45 6e 64 54 61 62 6c  |tquery>.#EndTabl|
00000450  65 0a 23 49 6e 64 65 6e  74 0a 0a 42 75 66 66 65  |e.#Indent..Buffe|
00000460  72 20 68 61 6e 64 6c 69  6e 67 20 3a 0a 23 49 6e  |r handling :.#In|
00000470  64 65 6e 74 20 32 0a 23  54 61 62 6c 65 20 43 6f  |dent 2.#Table Co|
00000480  6c 75 6d 6e 73 20 32 0a  3c 46 4e 62 75 66 66 65  |lumns 2.<FNbuffe|
00000490  72 5f 67 65 74 77 6f 72  64 3e 0a 3c 46 4e 62 75  |r_getword>.<FNbu|
000004a0  66 66 65 72 5f 67 65 74  72 65 73 74 3e 0a 23 45  |ffer_getrest>.#E|
000004b0  6e 64 54 61 62 6c 65 0a  23 49 6e 64 65 6e 74 0a  |ndTable.#Indent.|
000004c0  0a 4c 6f 67 67 69 6e 67  20 28 3c 53 79 73 4c 6f  |.Logging (<SysLo|
000004d0  67 3d 3e 53 57 49 3a 53  79 73 4c 6f 67 5f 3e 29  |g=>SWI:SysLog_>)|
000004e0  20 3a 0a 23 49 6e 64 65  6e 74 20 32 0a 23 54 61  | :.#Indent 2.#Ta|
000004f0  62 6c 65 20 43 6f 6c 75  6d 6e 73 20 33 0a 3c 50  |ble Columns 3.<P|
00000500  52 4f 43 73 79 73 6c 6f  67 3e 0a 3c 46 4e 6c 6f  |ROCsyslog>.<FNlo|
00000510  67 5f 6f 70 65 6e 73 65  73 73 69 6f 6e 3e 0a 3c  |g_opensession>.<|
00000520  50 52 4f 43 6c 6f 67 5f  63 6c 6f 73 65 73 65 73  |PROClog_closeses|
00000530  73 69 6f 6e 3e 0a 3c 50  52 4f 43 6c 6f 67 5f 73  |sion>.<PROClog_s|
00000540  65 73 73 69 6f 6e 3e 0a  3c 50 52 4f 43 6c 6f 67  |ession>.<PROClog|
00000550  5f 69 6e 64 65 6e 74 3e  0a 3c 50 52 4f 43 6c 6f  |_indent>.<PROClo|
00000560  67 5f 6f 75 74 64 65 6e  74 3e 0a 3c 50 52 4f 43  |g_outdent>.<PROC|
00000570  6c 6f 67 5f 64 61 74 61  3e 0a 23 45 6e 64 54 61  |log_data>.#EndTa|
00000580  62 6c 65 0a 23 49 6e 64  65 6e 74 0a 0a 3c 49 6e  |ble.#Indent..<In|
00000590  66 6f 72 6d 61 74 69 6f  6e 3d 3e 69 6e 66 6f 3e  |formation=>info>|
000005a0  20 6f 6e 20 53 6f 63 6b  65 74 4c 69 62 0a 00 00  | on SocketLib...|
000005b0  44 41 54 41 76 03 00 00  53 6f 63 6b 65 74 4c 69  |DATAv...SocketLi|
000005c0  62 20 68 65 6c 70 0a 23  41 6c 69 67 6e 20 43 65  |b help.#Align Ce|
000005d0  6e 74 72 65 0a 7b 66 68  33 7d 4a 46 53 68 61 72  |ntre.{fh3}JFShar|
000005e0  65 64 20 53 6f 63 6b 65  74 4c 69 62 20 76 31 2e  |ed SocketLib v1.|
000005f0  30 39 7b 66 7d 0a 23 41  6c 69 67 6e 20 4c 65 66  |09{f}.#Align Lef|
00000600  74 0a 0a 54 68 65 20 53  6f 63 6b 65 74 20 4c 69  |t..The Socket Li|
00000610  62 72 61 72 79 20 69 73  20 61 20 42 61 73 69 63  |brary is a Basic|
00000620  20 4c 69 62 72 61 72 79  20 66 69 6c 65 20 77 68  | Library file wh|
00000630  69 63 68 20 70 72 6f 76  69 64 65 73 20 61 6e 20  |ich provides an |
00000640  69 6e 74 65 72 66 61 63  65 20 74 6f 20 74 68 65  |interface to the|
00000650  20 3c 49 6e 74 65 72 6e  65 74 3d 3e 49 6e 74 65  | <Internet=>Inte|
00000660  72 6e 65 74 3a 21 52 6f  6f 74 3e 20 53 6f 63 6b  |rnet:!Root> Sock|
00000670  65 74 73 20 53 57 49 20  63 61 6c 6c 73 2e 20 49  |ets SWI calls. I|
00000680  6e 20 63 6f 6e 6a 75 6e  63 74 69 6f 6e 20 77 69  |n conjunction wi|
00000690  74 68 20 74 68 65 20 3c  57 69 6d 70 4c 69 62 3d  |th the <WimpLib=|
000006a0  3e 57 69 6d 70 4c 69 62  3a 21 52 6f 6f 74 3e 20  |>WimpLib:!Root> |
000006b0  61 6e 64 20 4a 46 53 68  61 72 65 64 20 73 6b 65  |and JFShared ske|
000006c0  6c 65 74 6f 6e 20 61 70  70 6c 69 63 61 74 69 6f  |leton applicatio|
000006d0  6e 20 74 68 69 73 20 70  72 6f 76 69 64 65 73 20  |n this provides |
000006e0  61 20 76 65 72 79 20 73  69 6d 70 6c 65 20 77 61  |a very simple wa|
000006f0  79 20 6f 66 20 63 72 65  61 74 69 6e 67 20 61 70  |y of creating ap|
00000700  70 6c 69 63 61 74 69 6f  6e 73 20 77 68 69 63 68  |plications which|
00000710  20 63 61 6e 20 74 61 6c  6b 20 74 6f 20 70 6f 72  | can talk to por|
00000720  74 73 20 61 63 72 6f 73  73 20 74 68 65 20 69 6e  |ts across the in|
00000730  74 65 72 6e 65 74 2c 20  6f 72 20 61 6e 20 69 6e  |ternet, or an in|
00000740  74 72 61 6e 65 74 2e 20  54 68 69 73 20 68 65 6c  |tranet. This hel|
00000750  70 20 66 69 6c 65 20 64  65 74 61 69 6c 73 20 74  |p file details t|
00000760  68 65 20 72 6f 75 74 69  6e 65 73 20 70 72 6f 76  |he routines prov|
00000770  69 64 65 64 20 69 6e 20  53 6f 63 6b 65 74 4c 69  |ided in SocketLi|
00000780  62 2e 0a 0a 54 68 65 20  53 6f 63 6b 65 74 20 4c  |b...The Socket L|
00000790  69 62 72 61 72 79 20 69  73 20 72 65 66 65 72 65  |ibrary is refere|
000007a0  6e 63 65 64 20 62 79 20  5c 3c 53 6f 63 6b 65 74  |nced by \<Socket|
000007b0  4c 69 62 72 61 72 79 24  46 69 6c 65 3e 20 61 6e  |Library$File> an|
000007c0  64 20 73 68 6f 75 6c 64  20 62 65 20 6c 6f 61 64  |d should be load|
000007d0  65 64 20 77 69 74 68 20  3a 0a 7b 66 43 6f 64 65  |ed with :.{fCode|
000007e0  7d 4c 49 42 52 41 52 59  20 22 5c 3c 53 6f 63 6b  |}LIBRARY "\<Sock|
000007f0  65 74 4c 69 62 72 61 72  79 24 46 69 6c 65 3e 22  |etLibrary$File>"|
00000800  3a 50 52 4f 43 69 6e 69  74 73 6f 63 6b 65 74 73  |:PROCinitsockets|
00000810  7b 66 7d 0a 0a 54 68 65  20 4a 46 53 68 61 72 65  |{f}..The JFShare|
00000820  64 20 61 70 70 6c 69 63  61 74 69 6f 6e 20 69 73  |d application is|
00000830  20 a9 20 3c 4a 75 73 74  69 6e 20 46 6c 65 74 63  | . <Justin Fletc|
00000840  68 65 72 3d 3e 46 69 6c  65 74 79 70 65 73 3a 41  |her=>Filetypes:A|
00000850  75 74 68 6f 72 73 5f 4a  75 73 74 69 6e 46 6c 65  |uthors_JustinFle|
00000860  74 63 68 65 72 3e 2c 20  31 39 39 37 20 61 6e 64  |tcher>, 1997 and|
00000870  20 69 73 20 72 65 6c 65  61 73 65 64 20 69 6e 74  | is released int|
00000880  6f 20 74 68 65 20 50 75  62 6c 69 63 20 44 6f 6d  |o the Public Dom|
00000890  61 69 6e 20 77 69 74 68  20 74 68 65 20 73 61 6d  |ain with the sam|
000008a0  65 20 72 65 73 74 72 69  63 74 69 6f 6e 73 20 61  |e restrictions a|
000008b0  73 20 73 75 62 73 69 73  74 20 69 6e 20 6d 6f 73  |s subsist in mos|
000008c0  74 20 50 44 20 73 6f 66  74 77 61 72 65 2e 20 54  |t PD software. T|
000008d0  68 69 73 20 69 6e 63 6c  75 64 65 73 20 74 68 65  |his includes the|
000008e0  20 66 61 63 74 20 74 68  61 74 20 77 68 65 6e 20  | fact that when |
000008f0  64 69 73 74 72 69 62 75  74 65 64 20 74 68 65 20  |distributed the |
00000900  65 6e 74 69 72 65 20 61  70 70 6c 69 63 61 74 69  |entire applicati|
00000910  6f 6e 20 6d 75 73 74 20  72 65 6d 61 69 6e 20 69  |on must remain i|
00000920  6e 74 61 63 74 2e 00 00  44 49 52 24 d8 00 00 00  |ntact...DIR$....|
00000930  d8 00 00 00 00 0a 00 00  46 ff ff ff ab ee 01 fb  |........F.......|
00000940  9d 00 00 00 13 00 00 00  00 00 00 00 69 6e 69 74  |............init|
00000950  73 6f 63 6b 65 74 73 00  a0 0a 00 00 47 ff ff ff  |sockets.....G...|
00000960  55 87 4b 54 0f 01 00 00  13 00 00 00 00 00 00 00  |U.KT............|
00000970  63 6c 6f 73 65 73 6f 63  6b 65 74 73 00 00 00 00  |closesockets....|
00000980  b0 0b 00 00 47 fd ff ff  2d bc 3f 72 08 01 00 00  |....G...-.?r....|
00000990  13 01 00 00 00 00 00 00  73 6f 63 6b 65 74 5f 00  |........socket_.|
000009a0  f4 13 00 00 47 fd ff ff  10 bf 3f 72 30 00 00 00  |....G.....?r0...|
000009b0  13 01 00 00 00 00 00 00  69 6e 65 74 5f 00 00 00  |........inet_...|
000009c0  48 15 00 00 47 ff ff ff  b4 4e 07 61 aa 00 00 00  |H...G....N.a....|
000009d0  13 00 00 00 00 00 00 00  73 79 73 6c 6f 67 00 00  |........syslog..|
000009e0  f4 15 00 00 47 fd ff ff  c6 bf 3f 72 b4 00 00 00  |....G.....?r....|
000009f0  13 01 00 00 00 00 00 00  6c 6f 67 5f 00 00 00 00  |........log_....|
00000a00  44 41 54 41 9d 00 00 00  50 52 4f 43 69 6e 69 74  |DATA....PROCinit|
00000a10  73 6f 63 6b 65 74 73 0a  23 50 61 72 65 6e 74 20  |sockets.#Parent |
00000a20  21 52 6f 6f 74 0a 49 6e  69 74 69 61 6c 69 73 65  |!Root.Initialise|
00000a30  20 74 68 65 20 73 6f 63  6b 65 74 73 20 6c 69 62  | the sockets lib|
00000a40  72 61 72 79 20 76 61 72  69 61 62 6c 65 73 0a 0a  |rary variables..|
00000a50  43 61 6c 6c 20 74 68 69  73 20 72 6f 75 74 69 6e  |Call this routin|
00000a60  65 20 61 74 20 74 68 65  20 73 74 61 72 74 20 6f  |e at the start o|
00000a70  66 20 61 6e 79 20 70 72  6f 67 72 61 6d 20 74 68  |f any program th|
00000a80  61 74 20 75 73 65 73 20  74 68 65 20 53 6f 63 6b  |at uses the Sock|
00000a90  65 74 73 4c 69 62 20 66  69 6c 65 2e 0a 00 00 00  |etsLib file.....|
00000aa0  44 41 54 41 0f 01 00 00  50 52 4f 43 63 6c 6f 73  |DATA....PROCclos|
00000ab0  65 73 6f 63 6b 65 74 73  0a 23 50 61 72 65 6e 74  |esockets.#Parent|
00000ac0  20 21 52 6f 6f 74 0a 53  68 75 74 73 64 6f 77 6e  | !Root.Shutsdown|
00000ad0  20 74 68 65 20 53 6f 63  6b 65 74 73 20 6c 69 62  | the Sockets lib|
00000ae0  72 61 72 79 2e 0a 0a 59  6f 75 20 6d 75 73 74 20  |rary...You must |
00000af0  63 61 6c 6c 20 74 68 69  73 20 72 6f 75 74 69 6e  |call this routin|
00000b00  65 20 61 74 20 74 68 65  20 65 6e 64 20 6f 66 20  |e at the end of |
00000b10  61 6e 79 20 70 72 6f 67  72 61 6d 20 77 68 69 63  |any program whic|
00000b20  68 20 75 73 65 73 20 74  68 65 20 6c 69 62 72 61  |h uses the libra|
00000b30  72 79 2e 20 49 74 20 77  69 6c 6c 20 63 6c 6f 73  |ry. It will clos|
00000b40  65 20 61 6c 6c 20 74 68  65 20 73 6f 63 6b 65 74  |e all the socket|
00000b50  73 20 63 75 72 72 65 6e  74 6c 79 20 6f 70 65 6e  |s currently open|
00000b60  20 61 6e 64 20 72 65 6c  65 61 73 65 20 61 6e 79  | and release any|
00000b70  20 6d 65 6d 6f 72 79 20  63 6c 61 69 6d 65 64 2c  | memory claimed,|
00000b80  20 61 73 20 77 65 6c 6c  20 61 73 20 72 65 6d 6f  | as well as remo|
00000b90  76 69 6e 67 20 61 6c 6c  20 6d 75 6c 74 69 74 61  |ving all multita|
00000ba0  73 6b 69 6e 67 20 6c 6f  6f 6b 75 70 73 2e 0a 00  |sking lookups...|
00000bb0  44 49 52 24 08 01 00 00  08 01 00 00 b8 0c 00 00  |DIR$............|
00000bc0  46 ff ff ff 88 45 02 fb  6d 00 00 00 13 00 00 00  |F....E..m.......|
00000bd0  00 00 00 00 63 6c 6f 73  65 00 00 00 28 0d 00 00  |....close...(...|
00000be0  46 ff ff ff a6 e2 02 fb  9e 01 00 00 13 00 00 00  |F...............|
00000bf0  00 00 00 00 6c 69 73 74  65 6e 00 00 c8 0e 00 00  |....listen......|
00000c00  46 ff ff ff 6d cb 03 fb  21 01 00 00 13 00 00 00  |F...m...!.......|
00000c10  00 00 00 00 6d 61 6b 65  62 75 66 66 65 72 65 64  |....makebuffered|
00000c20  00 00 00 00 ec 0f 00 00  46 ff ff ff 4e 0c 0a fb  |........F...N...|
00000c30  fe 00 00 00 13 00 00 00  00 00 00 00 6d 61 6b 65  |............make|
00000c40  6c 69 6e 67 65 72 00 00  ec 10 00 00 46 ff ff ff  |linger......F...|
00000c50  f7 42 0a fb 51 01 00 00  13 00 00 00 00 00 00 00  |.B..Q...........|
00000c60  6d 61 6b 65 72 65 75 73  61 62 6c 65 00 00 00 00  |makereusable....|
00000c70  40 12 00 00 46 ff ff ff  44 4c 0b fb eb 00 00 00  |@...F...DL......|
00000c80  13 00 00 00 00 00 00 00  73 65 6e 64 64 61 74 61  |........senddata|
00000c90  00 00 00 00 2c 13 00 00  46 ff ff ff b5 13 0b fd  |....,...F.......|
00000ca0  c6 00 00 00 13 00 00 00  00 00 00 00 73 65 6e 64  |............send|
00000cb0  6c 69 6e 65 00 00 00 00  44 41 54 41 6d 00 00 00  |line....DATAm...|
00000cc0  50 52 4f 43 73 6f 63 6b  65 74 5f 63 6c 6f 73 65  |PROCsocket_close|
00000cd0  28 73 6f 63 6b 65 74 29  0a 23 50 61 72 65 6e 74  |(socket).#Parent|
00000ce0  20 21 52 6f 6f 74 0a 3d  3e 09 7b 2f 7d 73 6f 63  | !Root.=>.{/}soc|
00000cf0  6b 65 74 7b 2f 7d 09 68  61 6e 64 6c 65 20 6f 66  |ket{/}.handle of|
00000d00  20 73 6f 63 6b 65 74 0a  0a 43 6c 6f 73 65 73 20  | socket..Closes |
00000d10  61 20 73 6f 63 6b 65 74  73 20 63 6f 6e 6e 65 63  |a sockets connec|
00000d20  74 69 6f 6e 2e 00 00 00  44 41 54 41 9e 01 00 00  |tion....DATA....|
00000d30  50 52 4f 43 73 6f 63 6b  65 74 5f 6c 69 73 74 65  |PROCsocket_liste|
00000d40  6e 28 73 6f 63 6b 65 74  2c 69 70 2c 70 6f 72 74  |n(socket,ip,port|
00000d50  29 0a 23 50 61 72 65 6e  74 20 21 52 6f 6f 74 0a  |).#Parent !Root.|
00000d60  3d 3e 09 2f 73 6f 63 6b  65 74 2f 09 68 61 6e 64  |=>./socket/.hand|
00000d70  6c 65 20 6f 66 20 73 6f  63 6b 65 74 20 61 73 20  |le of socket as |
00000d80  67 69 76 65 6e 20 62 79  20 3c 46 4e 73 6f 63 6b  |given by <FNsock|
00000d90  65 74 5f 63 72 65 61 74  65 69 6e 65 74 3e 0a 09  |et_createinet>..|
00000da0  2f 69 70 2f 09 09 61 64  64 72 65 73 73 20 6f 66  |/ip/..address of|
00000db0  20 68 6f 73 74 20 74 6f  20 61 63 63 65 70 74 20  | host to accept |
00000dc0  63 6f 6e 6e 65 63 74 69  6f 6e 73 20 66 72 6f 6d  |connections from|
00000dd0  20 28 75 73 75 61 6c 6c  79 20 30 29 0a 09 2f 70  | (usually 0)../p|
00000de0  6f 72 74 2f 09 09 70 6f  72 74 20 6e 75 6d 62 65  |ort/..port numbe|
00000df0  72 20 74 6f 20 6c 69 73  74 65 6e 20 6f 6e 0a 0a  |r to listen on..|
00000e00  4c 69 73 74 65 6e 73 20  66 6f 72 20 63 6f 6e 6e  |Listens for conn|
00000e10  65 63 74 69 6f 6e 73 20  6f 6e 20 61 20 73 70 65  |ections on a spe|
00000e20  63 69 66 69 63 20 73 6f  63 6b 65 74 2e 20 41 6e  |cific socket. An|
00000e30  20 65 72 72 6f 72 20 77  69 6c 6c 20 6f 63 63 75  | error will occu|
00000e40  72 20 69 66 20 74 68 65  20 73 70 65 63 69 66 69  |r if the specifi|
00000e50  65 64 20 70 6f 72 74 20  69 73 20 61 6c 72 65 61  |ed port is alrea|
00000e60  64 79 20 62 6f 75 6e 64  20 74 6f 20 61 6e 6f 74  |dy bound to anot|
00000e70  68 65 72 20 73 6f 63 6b  65 74 2e 20 55 73 65 20  |her socket. Use |
00000e80  3c 46 4e 73 6f 63 6b 65  74 5f 66 69 6e 64 6c 69  |<FNsocket_findli|
00000e90  73 74 65 6e 3e 20 69 66  20 79 6f 75 20 77 69 73  |sten> if you wis|
00000ea0  68 20 74 6f 20 62 65 20  61 6c 6c 6f 63 61 74 65  |h to be allocate|
00000eb0  64 20 61 20 73 6f 63 6b  65 74 20 69 6e 20 61 20  |d a socket in a |
00000ec0  72 61 6e 67 65 2e 00 00  44 41 54 41 21 01 00 00  |range...DATA!...|
00000ed0  50 52 4f 43 73 6f 63 6b  65 74 5f 6d 61 6b 65 62  |PROCsocket_makeb|
00000ee0  75 66 66 65 72 65 64 28  73 6f 63 6b 65 74 29 0a  |uffered(socket).|
00000ef0  23 50 61 72 65 6e 74 20  21 52 6f 6f 74 0a 3d 3e  |#Parent !Root.=>|
00000f00  09 2f 73 6f 63 6b 65 74  2f 09 68 61 6e 64 6c 65  |./socket/.handle|
00000f10  20 6f 66 20 73 6f 63 6b  65 74 20 61 73 20 67 69  | of socket as gi|
00000f20  76 65 6e 20 62 79 20 3c  46 4e 73 6f 63 6b 65 74  |ven by <FNsocket|
00000f30  5f 63 72 65 61 74 65 69  6e 65 74 3e 0a 0a 41 6c  |_createinet>..Al|
00000f40  6c 6f 63 61 74 65 73 20  61 20 62 75 66 66 65 72  |locates a buffer|
00000f50  20 66 6f 72 20 74 68 65  20 73 6f 63 6b 65 74 20  | for the socket |
00000f60  73 6f 20 74 68 61 74 20  63 61 6c 6c 73 20 74 6f  |so that calls to|
00000f70  20 3c 46 4e 73 6f 63 6b  65 74 5f 72 65 61 64 6c  | <FNsocket_readl|
00000f80  69 6e 65 3e 20 63 61 6e  20 62 65 20 75 73 65 64  |ine> can be used|
00000f90  2e 20 4f 74 68 65 72 77  69 73 65 20 79 6f 75 27  |. Otherwise you'|
00000fa0  6c 6c 20 68 61 76 65 20  74 6f 20 6a 75 73 74 20  |ll have to just |
00000fb0  75 73 65 20 3c 46 4e 73  6f 63 6b 65 74 5f 72 65  |use <FNsocket_re|
00000fc0  61 64 64 61 74 61 3e 20  70 61 73 73 69 6e 67 20  |addata> passing |
00000fd0  79 6f 75 72 20 6f 77 6e  20 6d 65 6d 6f 72 79 20  |your own memory |
00000fe0  70 6f 69 6e 74 65 72 2e  0a 00 00 00 44 41 54 41  |pointer.....DATA|
00000ff0  fe 00 00 00 50 52 4f 43  73 6f 63 6b 65 74 5f 6d  |....PROCsocket_m|
00001000  61 6b 65 6c 69 6e 67 65  72 28 73 6f 63 6b 65 74  |akelinger(socket|
00001010  2c 74 69 6d 65 29 0a 23  50 61 72 65 6e 74 20 21  |,time).#Parent !|
00001020  52 6f 6f 74 0a 3d 3e 09  2f 73 6f 63 6b 65 74 2f  |Root.=>./socket/|
00001030  09 68 61 6e 64 6c 65 20  6f 66 20 73 6f 63 6b 65  |.handle of socke|
00001040  74 20 61 73 20 67 69 76  65 6e 20 62 79 20 3c 46  |t as given by <F|
00001050  4e 73 6f 63 6b 65 74 5f  63 72 65 61 74 65 69 6e  |Nsocket_createin|
00001060  65 74 3e 0a 09 2f 74 69  6d 65 2f 09 09 74 69 6d  |et>../time/..tim|
00001070  65 20 74 6f 20 6c 69 6e  67 65 72 20 66 6f 72 20  |e to linger for |
00001080  69 6e 20 73 65 63 6f 6e  64 73 2c 20 6f 72 20 30  |in seconds, or 0|
00001090  20 74 6f 20 64 69 73 61  62 6c 65 0a 0a 45 6e 73  | to disable..Ens|
000010a0  75 72 65 73 20 74 68 61  74 20 74 68 65 20 73 6f  |ures that the so|
000010b0  63 6b 65 74 20 77 69 6c  6c 20 72 65 6d 61 69 6e  |cket will remain|
000010c0  20 76 61 6c 69 64 20 73  6f 20 74 68 61 74 20 64  | valid so that d|
000010d0  61 74 61 20 63 61 6e 20  62 65 20 72 65 61 64 20  |ata can be read |
000010e0  6f 6e 20 63 6c 6f 73 65  2e 0a 00 00 44 41 54 41  |on close....DATA|
000010f0  51 01 00 00 50 52 4f 43  73 6f 63 6b 65 74 5f 6d  |Q...PROCsocket_m|
00001100  61 6b 65 72 65 75 73 61  62 6c 65 28 73 6f 63 6b  |akereusable(sock|
00001110  65 74 2c 66 6c 61 67 29  0a 23 50 61 72 65 6e 74  |et,flag).#Parent|
00001120  20 21 52 6f 6f 74 0a 3d  3e 09 2f 73 6f 63 6b 65  | !Root.=>./socke|
00001130  74 2f 09 68 61 6e 64 6c  65 20 6f 66 20 73 6f 63  |t/.handle of soc|
00001140  6b 65 74 20 61 73 20 67  69 76 65 6e 20 62 79 20  |ket as given by |
00001150  3c 46 4e 73 6f 63 6b 65  74 5f 63 72 65 61 74 65  |<FNsocket_create|
00001160  69 6e 65 74 3e 0a 09 2f  66 6c 61 67 2f 09 09 54  |inet>../flag/..T|
00001170  52 55 45 20 74 6f 20 61  6c 6c 6f 77 20 74 68 65  |RUE to allow the|
00001180  20 61 64 64 72 65 73 73  20 74 6f 20 62 65 20 72  | address to be r|
00001190  65 2d 75 73 65 64 0a 0a  57 68 65 6e 20 79 6f 75  |e-used..When you|
000011a0  20 63 6c 6f 73 65 20 61  20 73 6f 63 6b 65 74 20  | close a socket |
000011b0  69 74 20 75 73 75 61 6c  6c 79 20 77 61 69 74 73  |it usually waits|
000011c0  20 66 6f 72 20 61 20 74  69 6d 65 20 62 65 66 6f  | for a time befo|
000011d0  72 65 20 61 6c 6c 6f 77  69 6e 67 20 61 6e 6f 74  |re allowing anot|
000011e0  68 65 72 20 73 6f 63 6b  65 74 20 74 6f 20 62 65  |her socket to be|
000011f0  20 63 72 65 61 74 65 64  20 6f 6e 20 74 68 65 20  | created on the |
00001200  73 61 6d 65 20 70 6f 72  74 2e 20 42 79 20 6d 61  |same port. By ma|
00001210  6b 69 6e 67 20 74 68 65  20 73 6f 63 6b 65 74 20  |king the socket |
00001220  72 65 75 73 61 62 6c 65  20 74 68 69 73 20 77 69  |reusable this wi|
00001230  6c 6c 20 6e 6f 74 20 6f  63 63 75 72 2e 00 00 00  |ll not occur....|
00001240  44 41 54 41 eb 00 00 00  50 52 4f 43 73 6f 63 6b  |DATA....PROCsock|
00001250  65 74 5f 73 65 6e 64 64  61 74 61 28 73 6f 63 6b  |et_senddata(sock|
00001260  65 74 2c 62 6c 6f 63 6b  2c 6c 65 6e 67 74 68 29  |et,block,length)|
00001270  0a 23 50 61 72 65 6e 74  20 21 52 6f 6f 74 0a 3d  |.#Parent !Root.=|
00001280  3e 09 2f 73 6f 63 6b 65  74 2f 09 68 61 6e 64 6c  |>./socket/.handl|
00001290  65 20 6f 66 20 73 6f 63  6b 65 74 20 61 73 20 67  |e of socket as g|
000012a0  69 76 65 6e 20 62 79 20  3c 46 4e 73 6f 63 6b 65  |iven by <FNsocke|
000012b0  74 5f 63 72 65 61 74 65  69 6e 65 74 3e 0a 09 2f  |t_createinet>../|
000012c0  62 6c 6f 63 6b 2f 09 09  70 6f 69 6e 74 65 72 20  |block/..pointer |
000012d0  74 6f 20 74 68 65 20 64  61 74 61 20 74 6f 20 73  |to the data to s|
000012e0  65 6e 64 0a 09 2f 6c 65  6e 67 74 68 2f 09 6c 65  |end../length/.le|
000012f0  6e 67 74 68 20 6f 66 20  64 61 74 61 20 74 6f 20  |ngth of data to |
00001300  73 65 6e 64 0a 0a 53 65  6e 64 73 20 61 20 62 6c  |send..Sends a bl|
00001310  6f 63 6b 20 6f 66 20 6d  65 6d 6f 72 79 20 74 6f  |ock of memory to|
00001320  20 61 20 73 6f 63 6b 65  74 2e 0a 00 44 41 54 41  | a socket...DATA|
00001330  c6 00 00 00 50 52 4f 43  73 6f 63 6b 65 74 5f 73  |....PROCsocket_s|
00001340  65 6e 64 6c 69 6e 65 28  73 6f 63 6b 65 74 2c 6c  |endline(socket,l|
00001350  69 6e 65 24 29 0a 23 50  61 72 65 6e 74 20 21 52  |ine$).#Parent !R|
00001360  6f 6f 74 0a 3d 3e 09 7b  2f 7d 73 6f 63 6b 65 74  |oot.=>.{/}socket|
00001370  7b 2f 7d 09 68 61 6e 64  6c 65 20 6f 66 20 73 6f  |{/}.handle of so|
00001380  63 6b 65 74 20 61 73 20  67 69 76 65 6e 20 62 79  |cket as given by|
00001390  20 3c 46 4e 73 6f 63 6b  65 74 5f 63 72 65 61 74  | <FNsocket_creat|
000013a0  65 69 6e 65 74 3e 0a 09  7b 2f 7d 6c 69 6e 65 24  |einet>..{/}line$|
000013b0  7b 2f 7d 09 09 6c 69 6e  65 20 74 6f 20 73 65 6e  |{/}..line to sen|
000013c0  64 0a 0a 53 65 6e 64 73  20 61 20 6c 69 6e 65 20  |d..Sends a line |
000013d0  74 6f 20 61 20 73 6f 63  6b 65 74 2c 20 4c 46 20  |to a socket, LF |
000013e0  28 26 31 30 29 20 74 65  72 6d 69 6e 61 74 65 64  |(&10) terminated|
000013f0  2e 0a 00 00 44 49 52 24  30 00 00 00 30 00 00 00  |....DIR$0...0...|
00001400  24 14 00 00 47 ff ff ff  a8 ec 4a 54 24 01 00 00  |$...G.....JT$...|
00001410  13 00 00 00 00 00 00 00  6b 69 6c 6c 6d 74 71 75  |........killmtqu|
00001420  65 72 79 00 44 41 54 41  24 01 00 00 50 52 4f 43  |ery.DATA$...PROC|
00001430  69 6e 65 74 5f 6b 69 6c  6c 6d 74 71 75 65 72 79  |inet_killmtquery|
00001440  28 68 61 6e 64 6c 65 29  0a 23 50 61 72 65 6e 74  |(handle).#Parent|
00001450  20 21 52 6f 6f 74 0a 3d  3e 09 7b 2f 7d 68 61 6e  | !Root.=>.{/}han|
00001460  64 6c 65 7b 2f 7d 09 68  61 6e 64 6c 65 20 72 65  |dle{/}.handle re|
00001470  74 75 72 6e 65 64 20 62  79 20 6f 6e 65 20 6f 66  |turned by one of|
00001480  20 74 68 65 20 46 4e 69  6e 65 74 5f 73 74 61 72  | the FNinet_star|
00001490  74 2e 2e 2e 20 63 61 6c  6c 73 0a 0a 44 65 73 74  |t... calls..Dest|
000014a0  72 6f 79 73 20 61 20 6d  75 6c 74 69 2d 74 61 73  |roys a multi-tas|
000014b0  6b 69 6e 67 20 6c 6f 6f  6b 75 70 2e 20 55 73 65  |king lookup. Use|
000014c0  20 74 68 69 73 20 69 66  20 79 6f 75 20 64 6f 6e  | this if you don|
000014d0  27 74 20 63 61 72 65 20  61 6e 79 6d 6f 72 65 20  |'t care anymore |
000014e0  77 68 61 74 20 74 68 65  20 61 64 64 72 65 73 73  |what the address|
000014f0  20 69 73 2e 20 54 68 69  73 20 69 73 20 70 65 72  | is. This is per|
00001500  66 6f 72 6d 65 64 20 61  75 74 6f 6d 61 74 69 63  |formed automatic|
00001510  61 6c 6c 79 20 61 66 74  65 72 20 72 65 61 64 69  |ally after readi|
00001520  6e 67 20 74 68 65 20 61  6e 73 77 65 72 20 77 69  |ng the answer wi|
00001530  74 68 20 46 4e 69 6e 65  74 5f 6d 74 67 65 74 68  |th FNinet_mtgeth|
00001540  6f 73 74 62 79 2e 2e 2e  44 41 54 41 aa 00 00 00  |ostby...DATA....|
00001550  50 52 4f 43 73 79 73 6c  6f 67 28 6c 65 76 65 6c  |PROCsyslog(level|
00001560  2c 74 65 78 74 24 29 0a  23 50 61 72 65 6e 74 20  |,text$).#Parent |
00001570  21 52 6f 6f 74 0a 3d 3e  09 7b 2f 7d 6c 65 76 65  |!Root.=>.{/}leve|
00001580  6c 7b 2f 7d 09 3c 70 72  69 6f 72 69 74 79 3d 3e  |l{/}.<priority=>|
00001590  53 57 49 3a 53 79 73 4c  6f 67 5f 70 72 69 6f 72  |SWI:SysLog_prior|
000015a0  69 74 69 65 73 3e 0a 09  7b 2f 7d 74 65 78 74 24  |ities>..{/}text$|
000015b0  7b 2f 7d 09 74 65 78 74  20 74 6f 20 6c 6f 67 0a  |{/}.text to log.|
000015c0  0a 4c 6f 67 20 61 20 6c  69 6e 65 20 74 6f 20 74  |.Log a line to t|
000015d0  68 65 20 6d 61 69 6e 20  6c 6f 67 20 66 6f 72 20  |he main log for |
000015e0  74 68 69 73 20 61 70 70  6c 69 63 61 74 69 6f 6e  |this application|
000015f0  2e 0a 00 00 44 49 52 24  b4 00 00 00 b4 00 00 00  |....DIR$........|
00001600  a8 16 00 00 47 ff ff ff  51 67 07 61 8d 00 00 00  |....G...Qg.a....|
00001610  13 00 00 00 00 00 00 00  63 6c 6f 73 65 73 65 73  |........closeses|
00001620  73 69 6f 6e 00 00 00 00  38 17 00 00 47 ff ff ff  |sion....8...G...|
00001630  97 9f 07 61 e2 00 00 00  13 00 00 00 00 00 00 00  |...a............|
00001640  73 65 73 73 69 6f 6e 00  1c 18 00 00 47 ff ff ff  |session.....G...|
00001650  c1 eb 07 61 a7 00 00 00  13 00 00 00 00 00 00 00  |...a............|
00001660  69 6e 64 65 6e 74 00 00  c4 18 00 00 47 ff ff ff  |indent......G...|
00001670  3a f9 07 61 a3 00 00 00  13 00 00 00 00 00 00 00  |:..a............|
00001680  6f 75 74 64 65 6e 74 00  68 19 00 00 47 ff ff ff  |outdent.h...G...|
00001690  6e 36 08 61 4b 01 00 00  13 00 00 00 00 00 00 00  |n6.aK...........|
000016a0  64 61 74 61 00 00 00 00  44 41 54 41 8d 00 00 00  |data....DATA....|
000016b0  50 52 4f 43 6c 6f 67 5f  63 6c 6f 73 65 73 65 73  |PROClog_closeses|
000016c0  73 69 6f 6e 28 73 65 73  73 69 6f 6e 29 0a 23 50  |sion(session).#P|
000016d0  61 72 65 6e 74 20 21 52  6f 6f 74 0a 3d 3e 09 7b  |arent !Root.=>.{|
000016e0  2f 7d 73 65 73 73 69 6f  6e 7b 2f 7d 09 73 65 73  |/}session{/}.ses|
000016f0  73 69 6f 6e 20 68 61 6e  64 6c 65 20 72 65 74 75  |sion handle retu|
00001700  72 6e 65 64 20 66 72 6f  6d 20 3c 46 4e 6c 6f 67  |rned from <FNlog|
00001710  5f 6f 70 65 6e 73 65 73  73 69 6f 6e 3e 0a 0a 43  |_opensession>..C|
00001720  6c 6f 73 65 73 20 61 20  73 65 73 73 69 6f 6e 20  |loses a session |
00001730  6c 6f 67 2e 0a 00 00 00  44 41 54 41 e2 00 00 00  |log.....DATA....|
00001740  50 52 4f 43 6c 6f 67 5f  73 65 73 73 69 6f 6e 28  |PROClog_session(|
00001750  73 65 73 73 69 6f 6e 2c  6c 65 76 65 6c 2c 74 65  |session,level,te|
00001760  78 74 29 0a 23 50 61 72  65 6e 74 20 21 52 6f 6f  |xt).#Parent !Roo|
00001770  74 0a 3d 3e 09 7b 2f 7d  73 65 73 73 69 6f 6e 7b  |t.=>.{/}session{|
00001780  2f 7d 09 73 65 73 73 69  6f 6e 20 68 61 6e 64 6c  |/}.session handl|
00001790  65 20 72 65 74 75 72 6e  65 64 20 66 72 6f 6d 20  |e returned from |
000017a0  3c 46 4e 6c 6f 67 5f 6f  70 65 6e 73 65 73 73 69  |<FNlog_opensessi|
000017b0  6f 6e 3e 0a 09 7b 2f 7d  6c 65 76 65 6c 7b 2f 7d  |on>..{/}level{/}|
000017c0  09 3c 70 72 69 6f 72 69  74 79 3d 3e 53 57 49 3a  |.<priority=>SWI:|
000017d0  53 79 73 4c 6f 67 5f 70  72 69 6f 72 69 74 69 65  |SysLog_prioritie|
000017e0  73 3e 0a 09 7b 2f 7d 74  65 78 74 24 7b 2f 7d 09  |s>..{/}text${/}.|
000017f0  74 65 78 74 20 74 6f 20  6c 6f 67 0a 0a 4c 6f 67  |text to log..Log|
00001800  20 61 20 6c 69 6e 65 20  74 6f 20 61 20 73 65 73  | a line to a ses|
00001810  73 69 6f 6e 20 6c 6f 67  2e 0a 00 00 44 41 54 41  |sion log....DATA|
00001820  a7 00 00 00 50 52 4f 43  6c 6f 67 5f 69 6e 64 65  |....PROClog_inde|
00001830  6e 74 28 6c 6f 67 29 0a  23 50 61 72 65 6e 74 20  |nt(log).#Parent |
00001840  21 52 6f 6f 74 0a 3d 3e  09 7b 2f 7d 6c 6f 67 7b  |!Root.=>.{/}log{|
00001850  2f 7d 09 73 65 73 73 69  6f 6e 20 68 61 6e 64 6c  |/}.session handl|
00001860  65 20 72 65 74 75 72 6e  65 64 20 66 72 6f 6d 20  |e returned from |
00001870  3c 46 4e 6c 6f 67 5f 6f  70 65 6e 73 65 73 73 69  |<FNlog_opensessi|
00001880  6f 6e 3e 2c 20 6f 72 20  2d 31 20 66 6f 72 20 64  |on>, or -1 for d|
00001890  65 66 61 75 6c 74 0a 0a  49 6e 64 65 6e 74 73 20  |efault..Indents |
000018a0  73 75 62 73 65 71 75 65  6e 74 20 6f 75 74 70 75  |subsequent outpu|
000018b0  74 20 74 6f 20 74 68 65  20 6c 6f 67 20 66 69 6c  |t to the log fil|
000018c0  65 2e 0a 00 44 41 54 41  a3 00 00 00 50 52 4f 43  |e...DATA....PROC|
000018d0  6c 6f 67 5f 6f 75 74 64  65 6e 74 28 6c 6f 67 29  |log_outdent(log)|
000018e0  0a 23 50 61 72 65 6e 74  20 21 52 6f 6f 74 0a 3d  |.#Parent !Root.=|
000018f0  3e 09 7b 2f 7d 6c 6f 67  7b 2f 7d 09 73 65 73 73  |>.{/}log{/}.sess|
00001900  69 6f 6e 20 68 61 6e 64  6c 65 20 72 65 74 75 72  |ion handle retur|
00001910  6e 65 64 20 66 72 6f 6d  20 3c 46 4e 6c 6f 67 5f  |ned from <FNlog_|
00001920  6f 70 65 6e 73 65 73 73  69 6f 6e 3e 2c 20 6f 72  |opensession>, or|
00001930  20 2d 31 20 66 6f 72 20  64 65 66 61 75 6c 74 0a  | -1 for default.|
00001940  0a 52 65 6d 6f 76 65 73  20 6f 6e 65 20 69 6e 64  |.Removes one ind|
00001950  65 6e 74 20 66 72 6f 6d  20 74 68 65 20 6c 6f 67  |ent from the log|
00001960  20 66 69 6c 65 2e 0a 00  44 41 54 41 4b 01 00 00  | file...DATAK...|
00001970  50 52 4f 43 6c 6f 67 5f  64 61 74 61 28 6c 6f 67  |PROClog_data(log|
00001980  2c 6c 65 76 65 6c 2c 64  61 74 61 2c 6c 65 6e 67  |,level,data,leng|
00001990  74 68 2c 73 74 61 72 74  29 0a 23 50 61 72 65 6e  |th,start).#Paren|
000019a0  74 20 21 52 6f 6f 74 0a  3d 3e 09 7b 2f 7d 6c 6f  |t !Root.=>.{/}lo|
000019b0  67 7b 2f 7d 09 73 65 73  73 69 6f 6e 20 68 61 6e  |g{/}.session han|
000019c0  64 6c 65 20 72 65 74 75  72 6e 65 64 20 66 72 6f  |dle returned fro|
000019d0  6d 20 3c 46 4e 6c 6f 67  5f 6f 70 65 6e 73 65 73  |m <FNlog_openses|
000019e0  73 69 6f 6e 3e 2c 20 6f  72 20 2d 31 20 66 6f 72  |sion>, or -1 for|
000019f0  20 64 65 66 61 75 6c 74  0a 09 7b 2f 7d 6c 65 76  | default..{/}lev|
00001a00  65 6c 7b 2f 7d 09 3c 70  72 69 6f 72 69 74 79 3d  |el{/}.<priority=|
00001a10  3e 53 57 49 3a 53 79 73  4c 6f 67 5f 70 72 69 6f  |>SWI:SysLog_prio|
00001a20  72 69 74 69 65 73 3e 0a  09 7b 2f 7d 64 61 74 61  |rities>..{/}data|
00001a30  7b 2f 7d 09 70 6f 69 6e  74 65 72 20 74 6f 20 74  |{/}.pointer to t|
00001a40  68 65 20 64 61 74 61 0a  09 7b 2f 7d 6c 65 6e 67  |he data..{/}leng|
00001a50  74 68 7b 2f 7d 09 6c 65  6e 67 74 68 20 6f 66 20  |th{/}.length of |
00001a60  64 61 74 61 0a 09 7b 2f  7d 73 74 61 72 74 7b 2f  |data..{/}start{/|
00001a70  7d 09 6f 66 66 73 65 74  20 6f 66 20 74 68 65 20  |}.offset of the |
00001a80  73 74 61 72 74 20 6f 66  20 74 68 65 20 64 61 74  |start of the dat|
00001a90  61 20 77 68 65 6e 20 6f  75 74 70 75 74 0a 0a 44  |a when output..D|
00001aa0  75 6d 70 73 20 61 20 64  61 74 61 20 62 6c 6f 63  |umps a data bloc|
00001ab0  6b 2e 0a 00 44 49 52 24  8c 00 00 00 8c 00 00 00  |k...DIR$........|
00001ac0  40 1b 00 00 47 fd ff ff  da c0 3f 72 ac 01 00 00  |@...G.....?r....|
00001ad0  13 01 00 00 00 00 00 00  73 6f 63 6b 65 74 5f 00  |........socket_.|
00001ae0  84 2d 00 00 47 fd ff ff  29 c2 3f 72 4c 00 00 00  |.-..G...).?rL...|
00001af0  13 01 00 00 00 00 00 00  62 75 66 66 65 72 5f 00  |........buffer_.|
00001b00  40 34 00 00 47 fd ff ff  74 c2 3f 72 f4 01 00 00  |@4..G...t.?r....|
00001b10  13 01 00 00 00 00 00 00  69 6e 65 74 5f 00 00 00  |........inet_...|
00001b20  18 42 00 00 47 fd ff ff  9f c3 3f 72 30 00 00 00  |.B..G.....?r0...|
00001b30  13 01 00 00 00 00 00 00  6c 6f 67 5f 00 00 00 00  |........log_....|
00001b40  44 49 52 24 ac 01 00 00  ac 01 00 00 ec 1c 00 00  |DIR$............|
00001b50  46 ff ff ff ba 94 02 fb  13 01 00 00 13 00 00 00  |F...............|
00001b60  00 00 00 00 63 6f 6e 6e  65 63 74 00 00 1e 00 00  |....connect.....|
00001b70  46 ff ff ff 1c 0f 03 fb  a8 01 00 00 13 00 00 00  |F...............|
00001b80  00 00 00 00 66 69 6e 64  6c 69 73 74 65 6e 00 00  |....findlisten..|
00001b90  a8 1f 00 00 46 ff ff ff  0e 5c 03 fb 29 01 00 00  |....F....\..)...|
00001ba0  13 00 00 00 00 00 00 00  61 63 63 65 70 74 00 00  |........accept..|
00001bb0  d4 20 00 00 46 ff ff ff  47 62 0a fb 05 01 00 00  |. ..F...Gb......|
00001bc0  13 00 00 00 00 00 00 00  69 6e 62 75 66 66 65 72  |........inbuffer|
00001bd0  00 00 00 00 dc 21 00 00  47 ff ff ff a0 be c0 31  |.....!..G......1|
00001be0  0a 01 00 00 13 00 00 00  00 00 00 00 65 6f 66 00  |............eof.|
00001bf0  e8 22 00 00 46 ff ff ff  3b c1 0a fb cf 01 00 00  |."..F...;.......|
00001c00  13 00 00 00 00 00 00 00  72 65 61 64 64 61 74 61  |........readdata|
00001c10  00 00 00 00 b8 24 00 00  46 ff ff ff 0b 2c 0d fb  |.....$..F....,..|
00001c20  69 02 00 00 13 00 00 00  00 00 00 00 72 65 61 64  |i...........read|
00001c30  6c 69 6e 65 00 00 00 00  24 27 00 00 46 ff ff ff  |line....$'..F...|
00001c40  61 8c 0b fb dc 00 00 00  13 00 00 00 00 00 00 00  |a...............|
00001c50  67 65 74 70 65 65 72 6e  61 6d 65 00 00 28 00 00  |getpeername..(..|
00001c60  47 ff ff ff ca 22 d1 6b  0c 01 00 00 13 00 00 00  |G....".k........|
00001c70  00 00 00 00 63 72 65 61  74 65 69 6e 65 74 00 00  |....createinet..|
00001c80  0c 29 00 00 47 ff ff ff  3a 87 48 54 02 02 00 00  |.)..G...:.HT....|
00001c90  13 00 00 00 00 00 00 00  6e 6f 62 6c 6f 63 6b 63  |........noblockc|
00001ca0  6f 6e 6e 65 63 74 00 00  10 2b 00 00 47 ff ff ff  |onnect...+..G...|
00001cb0  90 95 48 54 65 01 00 00  13 00 00 00 00 00 00 00  |..HTe...........|
00001cc0  72 65 61 64 79 00 00 00  78 2c 00 00 47 ff ff ff  |ready...x,..G...|
00001cd0  ec b6 d8 6b 0a 01 00 00  13 00 00 00 00 00 00 00  |...k............|
00001ce0  63 6f 6e 6e 65 63 74 65  64 00 00 00 44 41 54 41  |connected...DATA|
00001cf0  13 01 00 00 46 4e 73 6f  63 6b 65 74 5f 63 6f 6e  |....FNsocket_con|
00001d00  6e 65 63 74 28 73 6f 63  6b 65 74 2c 69 70 2c 70  |nect(socket,ip,p|
00001d10  6f 72 74 29 0a 23 50 61  72 65 6e 74 20 21 52 6f  |ort).#Parent !Ro|
00001d20  6f 74 0a 3d 3e 09 7b 2f  7d 73 6f 63 6b 65 74 7b  |ot.=>.{/}socket{|
00001d30  2f 7d 09 68 61 6e 64 6c  65 20 6f 66 20 73 6f 63  |/}.handle of soc|
00001d40  6b 65 74 20 61 73 20 67  69 76 65 6e 20 62 79 20  |ket as given by |
00001d50  3c 46 4e 73 6f 63 6b 65  74 5f 63 72 65 61 74 65  |<FNsocket_create|
00001d60  69 6e 65 74 3e 0a 09 2f  69 70 2f 09 09 61 64 64  |inet>../ip/..add|
00001d70  72 65 73 73 20 6f 66 20  68 6f 73 74 20 74 6f 20  |ress of host to |
00001d80  63 6f 6e 6e 65 63 74 20  74 6f 0a 09 2f 70 6f 72  |connect to../por|
00001d90  74 2f 09 09 70 6f 72 74  20 6e 75 6d 62 65 72 20  |t/..port number |
00001da0  74 6f 20 63 6f 6e 6e 65  63 74 20 74 6f 0a 3c 3d  |to connect to.<=|
00001db0  09 54 52 55 45 20 69 66  20 63 6f 6e 6e 65 63 74  |.TRUE if connect|
00001dc0  69 6f 6e 20 77 61 73 20  6d 61 64 65 20 73 75 63  |ion was made suc|
00001dd0  63 65 73 73 66 75 6c 6c  79 0a 0a 49 6e 69 74 69  |cessfully..Initi|
00001de0  61 74 65 73 20 61 20 63  6f 6e 6e 65 63 74 69 6f  |ates a connectio|
00001df0  6e 20 74 6f 20 61 20 73  6f 63 6b 65 74 2e 0a 00  |n to a socket...|
00001e00  44 41 54 41 a8 01 00 00  46 4e 73 6f 63 6b 65 74  |DATA....FNsocket|
00001e10  5f 66 69 6e 64 6c 69 73  74 65 6e 28 73 6f 63 6b  |_findlisten(sock|
00001e20  65 74 2c 69 70 2c 70 6f  72 74 29 0a 23 50 61 72  |et,ip,port).#Par|
00001e30  65 6e 74 20 21 52 6f 6f  74 0a 3d 3e 09 2f 73 6f  |ent !Root.=>./so|
00001e40  63 6b 65 74 2f 09 68 61  6e 64 6c 65 20 6f 66 20  |cket/.handle of |
00001e50  73 6f 63 6b 65 74 20 61  73 20 67 69 76 65 6e 20  |socket as given |
00001e60  62 79 20 3c 46 4e 73 6f  63 6b 65 74 5f 63 72 65  |by <FNsocket_cre|
00001e70  61 74 65 69 6e 65 74 3e  0a 09 2f 69 70 2f 09 09  |ateinet>../ip/..|
00001e80  61 64 64 72 65 73 73 20  6f 66 20 68 6f 73 74 20  |address of host |
00001e90  74 6f 20 61 63 63 65 70  74 20 63 6f 6e 6e 65 63  |to accept connec|
00001ea0  74 69 6f 6e 73 20 66 72  6f 6d 20 28 75 73 75 61  |tions from (usua|
00001eb0  6c 6c 79 20 30 29 0a 09  2f 70 6f 72 74 2f 09 09  |lly 0)../port/..|
00001ec0  70 6f 72 74 20 6e 75 6d  62 65 72 20 74 6f 20 6c  |port number to l|
00001ed0  69 73 74 65 6e 20 6f 6e  0a 09 2f 6c 69 6d 69 74  |isten on../limit|
00001ee0  2f 09 09 6c 69 6d 69 74  20 66 6f 72 20 73 65 61  |/..limit for sea|
00001ef0  72 63 68 20 28 69 65 20  31 20 66 6f 72 20 70 6f  |rch (ie 1 for po|
00001f00  72 74 20 3d 3e 20 28 70  6f 72 74 20 2b 31 29 29  |rt => (port +1))|
00001f10  0a 3c 3d 09 6e 75 6d 62  65 72 20 6f 66 20 70 6f  |.<=.number of po|
00001f20  72 74 20 6c 69 73 74 65  6e 69 6e 67 20 6f 6e 2c  |rt listening on,|
00001f30  20 6f 72 20 2d 31 20 69  66 20 6e 6f 74 20 70 6f  | or -1 if not po|
00001f40  73 73 69 62 6c 65 0a 0a  4c 69 73 74 65 6e 73 20  |ssible..Listens |
00001f50  66 6f 72 20 63 6f 6e 6e  65 63 74 69 6f 6e 73 20  |for connections |
00001f60  6f 6e 20 61 20 73 6f 63  6b 65 74 2c 20 6d 6f 76  |on a socket, mov|
00001f70  69 6e 67 20 74 6f 20 74  68 65 20 6e 65 78 74 20  |ing to the next |
00001f80  69 66 20 74 68 65 20 73  70 65 63 69 66 69 65 64  |if the specified|
00001f90  20 70 6f 72 74 20 69 73  20 61 6c 72 65 61 64 79  | port is already|
00001fa0  20 74 61 6b 65 6e 2e 0a  44 41 54 41 29 01 00 00  | taken..DATA)...|
00001fb0  46 4e 73 6f 63 6b 65 74  5f 61 63 63 65 70 74 28  |FNsocket_accept(|
00001fc0  73 6f 63 6b 65 74 29 0a  23 50 61 72 65 6e 74 20  |socket).#Parent |
00001fd0  21 52 6f 6f 74 0a 3d 3e  09 2f 73 6f 63 6b 65 74  |!Root.=>./socket|
00001fe0  2f 09 68 61 6e 64 6c 65  20 6f 66 20 73 6f 63 6b  |/.handle of sock|
00001ff0  65 74 20 61 73 20 67 69  76 65 6e 20 62 79 20 3c  |et as given by <|
00002000  46 4e 73 6f 63 6b 65 74  5f 63 72 65 61 74 65 69  |FNsocket_createi|
00002010  6e 65 74 3e 0a 3c 3d 09  6e 65 77 20 2f 73 6f 63  |net>.<=.new /soc|
00002020  6b 65 74 2f 20 68 61 6e  64 6c 65 2c 20 6f 72 20  |ket/ handle, or |
00002030  2d 31 20 69 66 20 6e 6f  20 63 6f 6e 6e 65 63 74  |-1 if no connect|
00002040  69 6f 6e 20 77 61 69 74  69 6e 67 2e 0a 0a 41 63  |ion waiting...Ac|
00002050  63 65 70 74 73 20 61 20  63 6f 6e 6e 65 63 74 69  |cepts a connecti|
00002060  6f 6e 20 63 75 72 72 65  6e 74 6c 79 20 77 61 69  |on currently wai|
00002070  74 69 6e 67 2e 20 54 68  65 20 72 65 74 75 72 6e  |ting. The return|
00002080  65 64 20 73 6f 63 6b 65  74 20 69 73 20 74 68 65  |ed socket is the|
00002090  20 6e 65 77 20 63 6f 6e  6e 65 63 74 69 6f 6e 2c  | new connection,|
000020a0  20 77 68 69 6c 73 74 20  74 68 65 20 6f 72 69 67  | whilst the orig|
000020b0  69 6e 61 6c 20 73 6f 63  6b 65 74 20 63 6f 6e 74  |inal socket cont|
000020c0  69 6e 75 65 73 20 6c 69  73 74 65 6e 69 6e 67 2e  |inues listening.|
000020d0  0a 00 00 00 44 41 54 41  05 01 00 00 46 4e 73 6f  |....DATA....FNso|
000020e0  63 6b 65 74 5f 69 6e 62  75 66 66 65 72 28 73 6f  |cket_inbuffer(so|
000020f0  63 6b 65 74 29 0a 23 50  61 72 65 6e 74 20 21 52  |cket).#Parent !R|
00002100  6f 6f 74 0a 3d 3e 09 2f  73 6f 63 6b 65 74 2f 09  |oot.=>./socket/.|
00002110  68 61 6e 64 6c 65 20 6f  66 20 73 6f 63 6b 65 74  |handle of socket|
00002120  20 61 73 20 67 69 76 65  6e 20 62 79 20 3c 46 4e  | as given by <FN|
00002130  73 6f 63 6b 65 74 5f 63  72 65 61 74 65 69 6e 65  |socket_createine|
00002140  74 3e 0a 3c 3d 09 61 6d  6f 75 6e 74 20 6f 66 20  |t>.<=.amount of |
00002150  64 61 74 61 20 77 61 69  74 69 6e 67 0a 0a 52 65  |data waiting..Re|
00002160  61 64 73 20 74 68 65 20  61 6d 6f 75 6e 74 20 6f  |ads the amount o|
00002170  66 20 64 61 74 61 20 77  61 69 74 69 6e 67 20 74  |f data waiting t|
00002180  6f 20 62 65 20 72 65 61  64 20 6f 6e 20 74 68 65  |o be read on the|
00002190  20 73 6f 63 6b 65 74 2e  20 55 73 65 20 3c 46 4e  | socket. Use <FN|
000021a0  73 6f 63 6b 65 74 5f 72  65 61 64 64 61 74 61 3e  |socket_readdata>|
000021b0  20 6f 72 20 3c 46 4e 73  6f 63 6b 65 74 5f 72 65  | or <FNsocket_re|
000021c0  61 64 6c 69 6e 65 3e 20  74 6f 20 72 65 61 64 20  |adline> to read |
000021d0  74 68 65 20 64 61 74 61  2e 00 00 00 44 41 54 41  |the data....DATA|
000021e0  0a 01 00 00 46 4e 73 6f  63 6b 65 74 5f 65 6f 66  |....FNsocket_eof|
000021f0  28 73 6f 63 6b 65 74 29  0a 23 50 61 72 65 6e 74  |(socket).#Parent|
00002200  20 21 52 6f 6f 74 0a 3d  3e 09 2f 73 6f 63 6b 65  | !Root.=>./socke|
00002210  74 2f 09 68 61 6e 64 6c  65 20 6f 66 20 73 6f 63  |t/.handle of soc|
00002220  6b 65 74 20 61 73 20 67  69 76 65 6e 20 62 79 20  |ket as given by |
00002230  3c 46 4e 73 6f 63 6b 65  74 5f 63 72 65 61 74 65  |<FNsocket_create|
00002240  69 6e 65 74 3e 0a 3c 3d  09 54 52 55 45 20 69 66  |inet>.<=.TRUE if|
00002250  20 74 68 65 20 6f 74 68  65 72 20 65 6e 64 20 68  | the other end h|
00002260  61 73 20 63 6c 6f 73 65  64 20 74 68 65 20 73 6f  |as closed the so|
00002270  63 6b 65 74 0a 0a 52 65  61 64 73 20 74 68 65 20  |cket..Reads the |
00002280  45 4f 46 20 63 6f 6e 64  69 74 69 6f 6e 20 6f 6e  |EOF condition on|
00002290  20 61 20 73 6f 63 6b 65  74 2e 0a 0a 4e 6f 74 65  | a socket...Note|
000022a0  3a 20 59 6f 75 20 61 72  65 20 73 74 69 6c 6c 20  |: You are still |
000022b0  72 65 71 75 69 72 65 64  20 74 6f 20 63 6c 6f 73  |required to clos|
000022c0  65 20 74 68 65 20 73 6f  63 6b 65 74 20 77 69 74  |e the socket wit|
000022d0  68 20 3c 50 52 4f 43 73  6f 63 6b 65 74 5f 63 6c  |h <PROCsocket_cl|
000022e0  6f 73 65 3e 2e 0a 00 00  44 41 54 41 cf 01 00 00  |ose>....DATA....|
000022f0  46 4e 73 6f 63 6b 65 74  5f 72 65 61 64 64 61 74  |FNsocket_readdat|
00002300  61 28 73 6f 63 6b 65 74  2c 73 74 61 72 74 29 0a  |a(socket,start).|
00002310  23 50 61 72 65 6e 74 20  21 52 6f 6f 74 0a 3d 3e  |#Parent !Root.=>|
00002320  09 2f 73 6f 63 6b 65 74  2f 09 68 61 6e 64 6c 65  |./socket/.handle|
00002330  20 6f 66 20 73 6f 63 6b  65 74 20 61 73 20 67 69  | of socket as gi|
00002340  76 65 6e 20 62 79 20 3c  46 4e 73 6f 63 6b 65 74  |ven by <FNsocket|
00002350  5f 63 72 65 61 74 65 69  6e 65 74 3e 0a 09 2f 73  |_createinet>../s|
00002360  74 61 72 74 2f 09 09 69  66 20 75 6e 62 75 66 66  |tart/..if unbuff|
00002370  65 72 65 64 2c 20 74 68  69 73 20 73 68 6f 75 6c  |ered, this shoul|
00002380  64 20 62 65 20 61 20 70  6f 69 6e 74 65 72 20 74  |d be a pointer t|
00002390  6f 20 61 20 62 6c 6f 63  6b 20 6f 66 20 6d 65 6d  |o a block of mem|
000023a0  6f 72 79 20 74 6f 20 72  65 61 64 20 74 68 65 20  |ory to read the |
000023b0  64 61 74 61 20 69 6e 74  6f 0a 3c 3d 09 6c 65 6e  |data into.<=.len|
000023c0  67 74 68 20 6f 66 20 64  61 74 61 20 72 65 61 64  |gth of data read|
000023d0  0a 09 2f 73 74 61 72 74  2f 09 09 69 66 20 62 75  |../start/..if bu|
000023e0  66 66 65 72 65 64 2c 20  74 68 69 73 20 77 69 6c  |ffered, this wil|
000023f0  6c 20 63 6f 6e 74 61 69  6e 20 74 68 65 20 70 6f  |l contain the po|
00002400  69 6e 74 65 72 20 74 6f  20 74 68 65 20 73 74 61  |inter to the sta|
00002410  72 74 20 6f 66 20 74 68  65 20 62 75 66 66 65 72  |rt of the buffer|
00002420  0a 0a 52 65 61 64 73 20  74 68 65 20 64 61 74 61  |..Reads the data|
00002430  20 63 75 72 72 65 6e 74  6c 79 20 77 61 69 74 69  | currently waiti|
00002440  6e 67 20 69 6e 74 6f 20  74 68 65 20 62 75 66 66  |ng into the buff|
00002450  65 72 20 73 70 65 63 69  66 69 65 64 2e 20 49 66  |er specified. If|
00002460  20 79 6f 75 20 61 72 65  20 75 73 69 6e 67 20 75  | you are using u|
00002470  6e 62 75 66 66 65 72 65  64 20 73 6f 63 6b 65 74  |nbuffered socket|
00002480  73 20 74 68 65 6e 20 79  6f 75 20 77 69 6c 6c 20  |s then you will |
00002490  6e 65 65 64 20 32 6b 20  74 6f 20 62 65 20 61 6c  |need 2k to be al|
000024a0  6c 6f 63 61 74 65 64 20  74 6f 20 74 68 65 20 62  |located to the b|
000024b0  75 66 66 65 72 2e 0a 00  44 41 54 41 69 02 00 00  |uffer...DATAi...|
000024c0  46 4e 73 6f 63 6b 65 74  5f 72 65 61 64 6c 69 6e  |FNsocket_readlin|
000024d0  65 28 73 6f 63 6b 65 74  2c 73 74 61 72 74 29 0a  |e(socket,start).|
000024e0  23 50 61 72 65 6e 74 20  21 52 6f 6f 74 0a 3d 3e  |#Parent !Root.=>|
000024f0  09 2f 73 6f 63 6b 65 74  2f 09 68 61 6e 64 6c 65  |./socket/.handle|
00002500  20 6f 66 20 73 6f 63 6b  65 74 20 61 73 20 67 69  | of socket as gi|
00002510  76 65 6e 20 62 79 20 3c  46 4e 73 6f 63 6b 65 74  |ven by <FNsocket|
00002520  5f 63 72 65 61 74 65 69  6e 65 74 3e 0a 3c 3d 09  |_createinet>.<=.|
00002530  6c 65 6e 67 74 68 20 6f  66 20 6c 69 6e 65 20 72  |length of line r|
00002540  65 61 64 0a 09 2f 73 74  61 72 74 2f 09 09 74 68  |ead../start/..th|
00002550  69 73 20 77 69 6c 6c 20  63 6f 6e 74 61 69 6e 20  |is will contain |
00002560  74 68 65 20 70 6f 69 6e  74 65 72 20 74 6f 20 74  |the pointer to t|
00002570  68 65 20 73 74 61 72 74  20 6f 66 20 74 68 65 20  |he start of the |
00002580  62 75 66 66 65 72 2c 20  6f 72 20 2d 31 20 69 66  |buffer, or -1 if|
00002590  20 6e 6f 20 6c 69 6e 65  20 63 6f 6d 70 6c 65 74  | no line complet|
000025a0  65 20 68 61 73 20 62 65  65 6e 20 72 65 63 65 69  |e has been recei|
000025b0  76 65 64 0a 0a 52 65 61  64 73 20 74 68 65 20 64  |ved..Reads the d|
000025c0  61 74 61 20 66 72 6f 6d  20 74 68 65 20 73 6f 63  |ata from the soc|
000025d0  6b 65 74 20 69 6e 74 6f  20 74 68 65 20 62 75 66  |ket into the buf|
000025e0  66 65 72 20 61 6e 64 20  72 65 74 75 72 6e 73 20  |fer and returns |
000025f0  61 20 70 6f 69 6e 74 65  72 20 74 6f 20 61 20 27  |a pointer to a '|
00002600  6c 69 6e 65 27 20 6f 66  20 74 65 78 74 2c 20 72  |line' of text, r|
00002610  65 74 75 72 6e 69 6e 67  20 74 68 65 20 6c 65 6e  |eturning the len|
00002620  67 74 68 2e 20 54 68 65  20 6c 69 6e 65 20 77 69  |gth. The line wi|
00002630  6c 6c 20 62 65 20 69 6e  20 61 20 74 65 6d 70 6f  |ll be in a tempo|
00002640  72 61 72 79 20 62 75 66  66 65 72 20 77 68 69 63  |rary buffer whic|
00002650  68 20 69 73 20 76 61 6c  69 64 20 75 6e 74 69 6c  |h is valid until|
00002660  20 74 68 65 20 6e 65 78  74 20 63 61 6c 6c 20 74  | the next call t|
00002670  6f 20 46 4e 73 6f 63 6b  65 74 5f 72 65 61 64 6c  |o FNsocket_readl|
00002680  69 6e 65 2e 20 54 68 69  73 20 63 61 6c 6c 20 69  |ine. This call i|
00002690  73 20 75 73 75 61 6c 6c  79 20 75 73 65 64 20 69  |s usually used i|
000026a0  6e 20 63 6f 6e 6a 75 6e  63 74 69 6f 6e 20 77 69  |n conjunction wi|
000026b0  74 68 20 74 68 65 20 3c  46 4e 62 75 66 66 65 72  |th the <FNbuffer|
000026c0  5f 67 65 74 77 6f 72 64  3e 20 61 6e 64 20 3c 46  |_getword> and <F|
000026d0  4e 62 75 66 66 65 72 5f  67 65 74 72 65 73 74 3e  |Nbuffer_getrest>|
000026e0  20 63 61 6c 6c 73 2e 0a  0a 4e 6f 74 65 3a 20 59  | calls...Note: Y|
000026f0  6f 75 20 63 61 6e 6e 6f  74 20 75 73 65 20 74 68  |ou cannot use th|
00002700  69 73 20 63 61 6c 6c 20  77 69 74 68 20 75 6e 62  |is call with unb|
00002710  75 66 66 65 72 65 64 20  73 6f 63 6b 65 74 73 2e  |uffered sockets.|
00002720  0a 00 00 00 44 41 54 41  dc 00 00 00 46 4e 73 6f  |....DATA....FNso|
00002730  63 6b 65 74 5f 67 65 74  70 65 65 72 6e 61 6d 65  |cket_getpeername|
00002740  28 73 6f 63 6b 65 74 29  0a 23 50 61 72 65 6e 74  |(socket).#Parent|
00002750  20 21 52 6f 6f 74 0a 3d  3e 09 2f 73 6f 63 6b 65  | !Root.=>./socke|
00002760  74 2f 09 68 61 6e 64 6c  65 20 6f 66 20 73 6f 63  |t/.handle of soc|
00002770  6b 65 74 20 61 73 20 67  69 76 65 6e 20 62 79 20  |ket as given by |
00002780  3c 46 4e 73 6f 63 6b 65  74 5f 63 72 65 61 74 65  |<FNsocket_create|
00002790  69 6e 65 74 3e 0a 3c 3d  09 6e 61 6d 65 20 6f 66  |inet>.<=.name of|
000027a0  20 68 6f 73 74 20 74 6f  20 77 68 69 63 68 20 73  | host to which s|
000027b0  6f 63 6b 65 74 20 69 73  20 63 6f 6e 6e 65 63 74  |ocket is connect|
000027c0  65 64 0a 0a 52 65 74 75  72 6e 73 20 74 68 65 20  |ed..Returns the |
000027d0  6e 61 6d 65 20 6f 66 20  74 68 65 20 68 6f 73 74  |name of the host|
000027e0  20 61 74 20 74 68 65 20  6f 74 68 65 72 20 65 6e  | at the other en|
000027f0  64 20 6f 66 20 74 68 65  20 73 6f 63 6b 65 74 2e  |d of the socket.|
00002800  44 41 54 41 0c 01 00 00  46 4e 73 6f 63 6b 65 74  |DATA....FNsocket|
00002810  5f 63 72 65 61 74 65 69  6e 65 74 0a 23 50 61 72  |_createinet.#Par|
00002820  65 6e 74 20 21 52 6f 6f  74 0a 3c 3d 09 2f 73 6f  |ent !Root.<=./so|
00002830  63 6b 65 74 2f 09 68 61  6e 64 6c 65 20 6f 66 20  |cket/.handle of |
00002840  6e 65 77 20 73 6f 63 6b  65 74 2c 20 6f 72 20 2d  |new socket, or -|
00002850  31 20 69 66 20 63 6f 75  6c 64 6e 27 74 20 63 72  |1 if couldn't cr|
00002860  65 61 74 65 20 69 74 0a  0a 43 72 65 61 74 65 73  |eate it..Creates|
00002870  20 61 20 73 6f 63 6b 65  74 20 66 6f 72 20 69 6e  | a socket for in|
00002880  74 65 72 6e 65 74 20 75  73 65 2e 0a 0a 4e 6f 74  |ternet use...Not|
00002890  65 3a 20 54 68 65 20 68  61 6e 64 6c 65 20 6f 66  |e: The handle of|
000028a0  20 74 68 65 20 73 6f 63  6b 65 74 20 69 73 20 4e  | the socket is N|
000028b0  4f 54 20 74 68 61 74 20  75 73 65 64 20 64 69 72  |OT that used dir|
000028c0  65 63 74 6c 79 20 62 79  20 74 68 65 20 53 6f 63  |ectly by the Soc|
000028d0  6b 65 74 20 53 57 49 73  2e 20 54 6f 20 72 65 61  |ket SWIs. To rea|
000028e0  64 20 74 68 61 74 20 79  6f 75 20 73 68 6f 75 6c  |d that you shoul|
000028f0  64 20 75 73 65 20 7b 2f  7d 73 6f 63 6b 25 28 73  |d use {/}sock%(s|
00002900  6f 63 6b 65 74 29 21 30  7b 2f 7d 2e 44 41 54 41  |ocket)!0{/}.DATA|
00002910  02 02 00 00 46 4e 73 6f  63 6b 65 74 5f 6e 6f 62  |....FNsocket_nob|
00002920  6c 6f 63 6b 63 6f 6e 6e  65 63 74 28 73 6f 63 6b  |lockconnect(sock|
00002930  65 74 2c 69 70 2c 70 6f  72 74 29 0a 23 50 61 72  |et,ip,port).#Par|
00002940  65 6e 74 20 21 52 6f 6f  74 0a 3d 3e 09 7b 2f 7d  |ent !Root.=>.{/}|
00002950  73 6f 63 6b 65 74 7b 2f  7d 09 68 61 6e 64 6c 65  |socket{/}.handle|
00002960  20 6f 66 20 73 6f 63 6b  65 74 20 61 73 20 67 69  | of socket as gi|
00002970  76 65 6e 20 62 79 20 3c  46 4e 73 6f 63 6b 65 74  |ven by <FNsocket|
00002980  5f 63 72 65 61 74 65 69  6e 65 74 3e 0a 09 2f 69  |_createinet>../i|
00002990  70 2f 09 09 61 64 64 72  65 73 73 20 6f 66 20 68  |p/..address of h|
000029a0  6f 73 74 20 74 6f 20 63  6f 6e 6e 65 63 74 20 74  |ost to connect t|
000029b0  6f 0a 09 2f 70 6f 72 74  2f 09 09 70 6f 72 74 20  |o../port/..port |
000029c0  6e 75 6d 62 65 72 20 74  6f 20 63 6f 6e 6e 65 63  |number to connec|
000029d0  74 20 74 6f 0a 3c 3d 09  54 52 55 45 20 69 66 20  |t to.<=.TRUE if |
000029e0  63 6f 6e 6e 65 63 74 69  6f 6e 20 77 61 73 20 6d  |connection was m|
000029f0  61 64 65 20 73 75 63 63  65 73 73 66 75 6c 6c 79  |ade successfully|
00002a00  2c 0a 09 46 41 4c 53 45  20 69 66 20 63 6f 6e 6e  |,..FALSE if conn|
00002a10  65 63 74 69 6f 6e 20 77  61 73 20 75 6e 73 75 63  |ection was unsuc|
00002a20  63 65 73 73 66 75 6c 2c  0a 09 31 20 69 66 20 63  |cessful,..1 if c|
00002a30  6f 6e 6e 65 63 74 69 6f  6e 20 69 73 20 73 74 69  |onnection is sti|
00002a40  6c 6c 20 62 65 69 6e 67  20 6d 61 64 65 0a 0a 49  |ll being made..I|
00002a50  6e 69 74 69 61 74 65 73  20 61 20 63 6f 6e 6e 65  |nitiates a conne|
00002a60  63 74 69 6f 6e 20 74 6f  20 61 20 73 6f 63 6b 65  |ction to a socke|
00002a70  74 2e 20 49 66 20 31 20  69 73 20 72 65 74 75 72  |t. If 1 is retur|
00002a80  6e 65 64 2c 20 79 6f 75  20 73 68 6f 75 6c 64 20  |ned, you should |
00002a90  63 61 6c 6c 20 3c 46 4e  73 6f 63 6b 65 74 5f 72  |call <FNsocket_r|
00002aa0  65 61 64 79 3e 28 7b 2f  7d 73 6f 63 6b 65 74 7b  |eady>({/}socket{|
00002ab0  2f 7d 2c 46 41 4c 53 45  29 20 72 65 70 65 61 74  |/},FALSE) repeat|
00002ac0  65 64 6c 79 20 75 6e 74  69 6c 20 74 68 65 20 63  |edly until the c|
00002ad0  6f 6e 6e 65 63 74 69 6f  6e 20 69 73 20 6d 61 64  |onnection is mad|
00002ae0  65 20 6f 72 20 66 61 69  6c 73 20 28 6f 72 20 75  |e or fails (or u|
00002af0  6e 74 69 6c 20 79 6f 75  20 64 65 63 69 64 65 20  |ntil you decide |
00002b00  74 6f 20 74 69 6d 65 20  6f 75 74 29 2e 0a 00 00  |to time out)....|
00002b10  44 41 54 41 65 01 00 00  46 4e 73 6f 63 6b 65 74  |DATAe...FNsocket|
00002b20  5f 72 65 61 64 79 28 73  6f 63 6b 65 74 2c 72 65  |_ready(socket,re|
00002b30  61 64 29 0a 23 50 61 72  65 6e 74 20 21 52 6f 6f  |ad).#Parent !Roo|
00002b40  74 0a 3d 3e 09 7b 2f 7d  73 6f 63 6b 65 74 7b 2f  |t.=>.{/}socket{/|
00002b50  7d 09 68 61 6e 64 6c 65  20 6f 66 20 73 6f 63 6b  |}.handle of sock|
00002b60  65 74 20 61 73 20 67 69  76 65 6e 20 62 79 20 3c  |et as given by <|
00002b70  46 4e 73 6f 63 6b 65 74  5f 63 72 65 61 74 65 69  |FNsocket_createi|
00002b80  6e 65 74 3e 0a 09 7b 2f  7d 72 65 61 64 7b 2f 7d  |net>..{/}read{/}|
00002b90  09 54 52 55 45 20 6d 65  61 6e 73 20 74 65 73 74  |.TRUE means test|
00002ba0  20 69 66 20 73 6f 63 6b  65 74 20 69 73 20 72 65  | if socket is re|
00002bb0  61 64 79 20 74 6f 20 62  65 20 72 65 61 64 2c 0a  |ady to be read,.|
00002bc0  09 20 09 09 46 41 4c 53  45 20 6d 65 61 6e 73 20  |. ..FALSE means |
00002bd0  74 65 73 74 20 69 66 20  72 65 61 64 79 20 74 6f  |test if ready to|
00002be0  20 77 72 69 74 65 0a 3c  3d 09 31 20 69 66 20 74  | write.<=.1 if t|
00002bf0  68 65 20 73 6f 63 6b 65  74 20 69 73 20 72 65 61  |he socket is rea|
00002c00  64 79 20 66 6f 72 20 75  73 65 2c 20 30 20 69 66  |dy for use, 0 if|
00002c10  20 6e 6f 74 3b 20 2d 31  20 6f 6e 20 65 72 72 6f  | not; -1 on erro|
00002c20  72 0a 0a 44 69 73 63 6f  76 65 72 73 20 77 68 65  |r..Discovers whe|
00002c30  74 68 65 72 20 61 20 73  6f 63 6b 65 74 20 69 73  |ther a socket is|
00002c40  20 72 65 61 64 79 20 74  6f 20 75 73 65 2e 20 55  | ready to use. U|
00002c50  73 65 64 20 61 66 74 65  72 20 3c 46 4e 73 6f 63  |sed after <FNsoc|
00002c60  6b 65 74 5f 6e 6f 62 6c  6f 63 6b 63 6f 6e 6e 65  |ket_noblockconne|
00002c70  63 74 3e 2e 0a 00 00 00  44 41 54 41 0a 01 00 00  |ct>.....DATA....|
00002c80  46 4e 73 6f 63 6b 65 74  5f 63 6f 6e 6e 65 63 74  |FNsocket_connect|
00002c90  65 64 28 73 6f 63 6b 65  74 29 0a 23 50 61 72 65  |ed(socket).#Pare|
00002ca0  6e 74 20 21 52 6f 6f 74  0a 3d 3e 09 7b 2f 7d 73  |nt !Root.=>.{/}s|
00002cb0  6f 63 6b 65 74 7b 2f 7d  09 68 61 6e 64 6c 65 20  |ocket{/}.handle |
00002cc0  6f 66 20 73 6f 63 6b 65  74 20 61 73 20 67 69 76  |of socket as giv|
00002cd0  65 6e 20 62 79 20 3c 46  4e 73 6f 63 6b 65 74 5f  |en by <FNsocket_|
00002ce0  63 72 65 61 74 65 69 6e  65 74 3e 0a 3c 3d 09 54  |createinet>.<=.T|
00002cf0  52 55 45 20 69 66 20 63  6f 6e 6e 65 63 74 65 64  |RUE if connected|
00002d00  2c 20 46 41 4c 53 45 20  69 66 20 6e 6f 74 20 79  |, FALSE if not y|
00002d10  65 74 2c 20 65 72 72 6f  72 20 6e 75 6d 62 65 72  |et, error number|
00002d20  20 69 66 20 66 61 69 6c  65 64 0a 0a 44 69 73 63  | if failed..Disc|
00002d30  6f 76 65 72 73 20 77 68  65 74 68 65 72 20 61 20  |overs whether a |
00002d40  73 6f 63 6b 65 74 20 69  73 20 63 6f 6e 6e 65 63  |socket is connec|
00002d50  74 65 64 20 6f 72 20 6e  6f 74 2e 20 55 73 65 64  |ted or not. Used|
00002d60  20 61 66 74 65 72 20 3c  46 4e 73 6f 63 6b 65 74  | after <FNsocket|
00002d70  5f 6e 6f 62 6c 6f 63 6b  63 6f 6e 6e 65 63 74 3e  |_noblockconnect>|
00002d80  2e 0a 00 00 44 49 52 24  4c 00 00 00 4c 00 00 00  |....DIR$L...L...|
00002d90  d0 2d 00 00 46 ff ff ff  e7 fc 0d fb c8 03 00 00  |.-..F...........|
00002da0  13 00 00 00 00 00 00 00  67 65 74 77 6f 72 64 00  |........getword.|
00002db0  98 31 00 00 46 ff ff ff  94 ec 0d fb a5 02 00 00  |.1..F...........|
00002dc0  13 00 00 00 00 00 00 00  67 65 74 72 65 73 74 00  |........getrest.|
00002dd0  44 41 54 41 c8 03 00 00  46 4e 62 75 66 66 65 72  |DATA....FNbuffer|
00002de0  5f 67 65 74 77 6f 72 64  28 73 74 61 72 74 2c 6c  |_getword(start,l|
00002df0  65 6e 2c 70 74 72 29 0a  23 50 61 72 65 6e 74 20  |en,ptr).#Parent |
00002e00  21 52 6f 6f 74 0a 3d 3e  09 2f 73 74 61 72 74 2f  |!Root.=>./start/|
00002e10  09 73 74 61 72 74 20 6f  66 20 64 61 74 61 0a 09  |.start of data..|
00002e20  2f 6c 65 6e 2f 09 6c 65  6e 67 74 68 20 6f 66 20  |/len/.length of |
00002e30  64 61 74 61 20 69 6e 20  62 6c 6f 63 6b 0a 09 2f  |data in block../|
00002e40  70 74 72 2f 09 6f 66 66  73 65 74 20 74 6f 20 66  |ptr/.offset to f|
00002e50  69 72 73 74 20 62 79 74  65 20 74 6f 20 72 65 61  |irst byte to rea|
00002e60  64 0a 3c 3d 09 77 6f 72  64 20 72 65 61 64 2c 20  |d.<=.word read, |
00002e70  6f 72 20 4e 55 4c 4c 20  69 66 20 6e 6f 6e 65 2e  |or NULL if none.|
00002e80  0a 09 2f 70 74 72 2f 09  75 70 64 61 74 65 64 0a  |../ptr/.updated.|
00002e90  0a 52 65 61 64 73 20 61  20 74 65 78 74 75 61 6c  |.Reads a textual|
00002ea0  20 77 6f 72 64 20 66 72  6f 6d 20 74 68 65 20 62  | word from the b|
00002eb0  6c 6f 63 6b 20 73 70 65  63 69 66 69 65 64 2c 20  |lock specified, |
00002ec0  73 6b 69 70 70 69 6e 67  20 6c 65 61 64 69 6e 67  |skipping leading|
00002ed0  20 73 70 61 63 65 73 2e  0a 0a 43 6c 69 63 6b 20  | spaces...Click |
00002ee0  3c 68 65 72 65 3d 3e 2e  65 78 61 6d 70 6c 65 3e  |<here=>.example>|
00002ef0  20 66 6f 72 20 61 6e 20  65 78 61 6d 70 6c 65 2e  | for an example.|
00002f00  0a 23 53 75 62 70 61 67  65 20 65 78 61 6d 70 6c  |.#Subpage exampl|
00002f10  65 0a 46 4e 62 75 66 66  65 72 5f 67 65 74 77 6f  |e.FNbuffer_getwo|
00002f20  72 64 20 65 78 61 6d 70  6c 65 73 0a 54 68 69 73  |rd examples.This|
00002f30  20 69 73 20 6a 75 73 74  20 61 20 73 69 6d 70 6c  | is just a simpl|
00002f40  65 20 65 78 61 6d 70 6c  65 20 74 6f 20 77 61 69  |e example to wai|
00002f50  74 20 66 6f 72 20 48 45  4c 4f 20 5c 3c 68 6f 73  |t for HELO \<hos|
00002f60  74 6e 61 6d 65 3e 20 61  73 20 6d 69 67 68 74 20  |tname> as might |
00002f70  62 65 20 64 6f 6e 65 20  62 79 20 61 6e 20 53 4d  |be done by an SM|
00002f80  54 50 20 73 65 72 76 65  72 2e 0a 23 66 43 6f 64  |TP server..#fCod|
00002f90  65 0a 52 45 50 45 41 54  0a 20 6c 65 6e 3d 46 4e  |e.REPEAT. len=FN|
00002fa0  73 6f 63 6b 65 74 5f 72  65 61 64 6c 69 6e 65 28  |socket_readline(|
00002fb0  6d 61 69 6e 73 6f 63 6b  65 74 25 2c 73 74 61 72  |mainsocket%,star|
00002fc0  74 29 0a 20 49 46 20 6c  65 6e 3e 30 20 54 48 45  |t). IF len>0 THE|
00002fd0  4e 0a 20 20 70 74 72 3d  30 0a 20 20 61 24 3d 46  |N.  ptr=0.  a$=F|
00002fe0  4e 62 75 66 66 65 72 5f  67 65 74 77 6f 72 64 28  |Nbuffer_getword(|
00002ff0  73 74 61 72 74 2c 6c 65  6e 2c 70 74 72 29 0a 20  |start,len,ptr). |
00003000  20 49 46 20 61 24 3d 22  48 45 4c 4f 22 20 54 48  | IF a$="HELO" TH|
00003010  45 4e 0a 20 20 20 61 24  3d 46 4e 62 75 66 66 65  |EN.   a$=FNbuffe|
00003020  72 5f 67 65 74 77 6f 72  64 28 73 74 61 72 74 2c  |r_getword(start,|
00003030  6c 65 6e 2c 70 74 72 29  0a 20 20 20 49 46 20 61  |len,ptr).   IF a|
00003040  24 5c 3c 3e 46 4e 73 6f  63 6b 65 74 5f 67 65 74  |$\<>FNsocket_get|
00003050  70 65 65 72 6e 61 6d 65  28 6d 61 69 6e 73 6f 63  |peername(mainsoc|
00003060  6b 65 74 25 29 20 54 48  45 4e 0a 20 20 20 20 7b  |ket%) THEN.    {|
00003070  66 3b 2f 7d 2e 2e 2e 20  74 68 65 79 20 67 61 76  |f;/}... they gav|
00003080  65 20 75 73 20 74 68 65  20 77 72 6f 6e 67 20 68  |e us the wrong h|
00003090  6f 73 74 20 6e 61 6d 65  7b 2f 3b 66 43 6f 64 65  |ost name{/;fCode|
000030a0  7d 0a 20 20 20 45 4c 53  45 0a 20 20 20 20 7b 66  |}.   ELSE.    {f|
000030b0  3b 2f 7d 2e 2e 2e 20 74  68 65 79 20 67 61 76 65  |;/}... they gave|
000030c0  20 75 73 20 74 68 65 20  72 69 67 68 74 20 68 6f  | us the right ho|
000030d0  73 74 20 6e 61 6d 65 7b  2f 3b 66 43 6f 64 65 7d  |st name{/;fCode}|
000030e0  0a 20 20 20 45 4e 44 49  46 0a 20 20 45 4c 53 45  |.   ENDIF.  ELSE|
000030f0  0a 20 20 20 7b 66 3b 2f  7d 2e 2e 2e 20 64 6f 20  |.   {f;/}... do |
00003100  73 6f 6d 65 74 68 69 6e  67 20 65 6c 73 65 20 27  |something else '|
00003110  63 6f 73 20 69 74 27 73  20 6e 6f 74 20 48 45 4c  |cos it's not HEL|
00003120  4f 7b 2f 3b 66 43 6f 64  65 7d 0a 20 20 45 4e 44  |O{/;fCode}.  END|
00003130  49 46 0a 20 45 4e 44 49  46 0a 55 4e 54 49 4c 20  |IF. ENDIF.UNTIL |
00003140  46 4e 73 6f 63 6b 65 74  5f 65 6f 66 28 6d 61 69  |FNsocket_eof(mai|
00003150  6e 73 6f 63 6b 65 74 25  29 0a 23 66 0a 0a 4e 6f  |nsocket%).#f..No|
00003160  74 65 3a 20 49 20 68 61  76 65 6e 27 74 20 74 65  |te: I haven't te|
00003170  73 74 65 64 20 74 68 69  73 2c 20 69 74 27 73 20  |sted this, it's |
00003180  69 73 20 6f 6e 6c 79 20  66 6f 72 20 69 6e 66 6f  |is only for info|
00003190  72 6d 61 74 69 6f 6e 0a  44 41 54 41 a5 02 00 00  |rmation.DATA....|
000031a0  46 4e 62 75 66 66 65 72  5f 67 65 74 72 65 73 74  |FNbuffer_getrest|
000031b0  28 73 74 61 72 74 2c 6c  65 6e 2c 70 74 72 29 0a  |(start,len,ptr).|
000031c0  23 50 61 72 65 6e 74 20  21 52 6f 6f 74 0a 3d 3e  |#Parent !Root.=>|
000031d0  09 2f 73 74 61 72 74 2f  09 73 74 61 72 74 20 6f  |./start/.start o|
000031e0  66 20 64 61 74 61 0a 09  2f 6c 65 6e 2f 09 6c 65  |f data../len/.le|
000031f0  6e 67 74 68 20 6f 66 20  64 61 74 61 20 69 6e 20  |ngth of data in |
00003200  62 6c 6f 63 6b 0a 09 2f  70 74 72 2f 09 6f 66 66  |block../ptr/.off|
00003210  73 65 74 20 74 6f 20 66  69 72 73 74 20 62 79 74  |set to first byt|
00003220  65 20 74 6f 20 72 65 61  64 0a 3c 3d 09 6c 69 6e  |e to read.<=.lin|
00003230  65 20 72 65 61 64 2c 20  6f 72 20 4e 55 4c 4c 20  |e read, or NULL |
00003240  69 66 20 6e 6f 6e 65 2e  0a 09 2f 70 74 72 2f 09  |if none.../ptr/.|
00003250  75 70 64 61 74 65 64 0a  0a 52 65 61 64 73 20 74  |updated..Reads t|
00003260  68 65 20 72 65 73 74 20  6f 66 20 74 68 65 20 6c  |he rest of the l|
00003270  69 6e 65 20 66 72 6f 6d  20 74 68 65 20 62 75 66  |ine from the buf|
00003280  66 65 72 2c 20 73 74 6f  70 70 69 6e 67 20 77 68  |fer, stopping wh|
00003290  65 6e 20 61 20 4c 46 20  28 26 30 41 29 20 6f 72  |en a LF (&0A) or|
000032a0  20 43 52 20 28 26 30 44  29 20 69 73 20 65 6e 63  | CR (&0D) is enc|
000032b0  6f 75 6e 74 65 72 65 64  2e 0a 0a 43 6c 69 63 6b  |ountered...Click|
000032c0  20 3c 68 65 72 65 3d 3e  2e 65 78 61 6d 70 6c 65  | <here=>.example|
000032d0  3e 20 66 6f 72 20 61 6e  20 65 78 61 6d 70 6c 65  |> for an example|
000032e0  2e 0a 23 53 75 62 70 61  67 65 20 65 78 61 6d 70  |..#Subpage examp|
000032f0  6c 65 0a 46 4e 62 75 66  66 65 72 5f 67 65 74 72  |le.FNbuffer_getr|
00003300  65 73 74 20 65 78 61 6d  70 6c 65 73 0a 54 68 69  |est examples.Thi|
00003310  73 20 69 73 20 6a 75 73  74 20 61 20 73 69 6d 70  |s is just a simp|
00003320  6c 65 20 65 78 61 6d 70  6c 65 20 74 6f 20 74 68  |le example to th|
00003330  72 6f 77 20 77 68 61 74  65 76 65 72 20 63 6f 6d  |row whatever com|
00003340  65 73 20 66 72 6f 6d 20  74 68 65 20 70 6f 72 74  |es from the port|
00003350  20 61 74 20 74 68 65 20  73 63 72 65 65 6e 2e 0a  | at the screen..|
00003360  0a 23 66 43 6f 64 65 0a  52 45 50 45 41 54 0a 20  |.#fCode.REPEAT. |
00003370  6c 65 6e 3d 46 4e 73 6f  63 6b 65 74 5f 72 65 61  |len=FNsocket_rea|
00003380  64 6c 69 6e 65 28 6d 61  69 6e 73 6f 63 6b 65 74  |dline(mainsocket|
00003390  25 2c 73 74 61 72 74 29  0a 20 49 46 20 6c 65 6e  |%,start). IF len|
000033a0  3e 30 20 54 48 45 4e 0a  20 20 61 24 3d 46 4e 62  |>0 THEN.  a$=FNb|
000033b0  75 66 66 65 72 5f 67 65  74 72 65 73 74 28 73 74  |uffer_getrest(st|
000033c0  61 72 74 2c 6c 65 6e 2c  70 74 72 29 0a 20 20 50  |art,len,ptr).  P|
000033d0  52 49 4e 54 20 61 24 0a  20 45 4e 44 49 46 0a 55  |RINT a$. ENDIF.U|
000033e0  4e 54 49 4c 20 46 4e 73  6f 63 6b 65 74 5f 65 6f  |NTIL FNsocket_eo|
000033f0  66 28 6d 61 69 6e 73 6f  63 6b 65 74 25 29 0a 23  |f(mainsocket%).#|
00003400  66 0a 0a 4e 6f 74 65 3a  20 49 20 68 61 76 65 6e  |f..Note: I haven|
00003410  27 74 20 74 65 73 74 65  64 20 74 68 69 73 2c 20  |'t tested this, |
00003420  69 74 27 73 20 69 73 20  6f 6e 6c 79 20 66 6f 72  |it's is only for|
00003430  20 69 6e 66 6f 72 6d 61  74 69 6f 6e 0a 00 00 00  | information....|
00003440  44 49 52 24 f4 01 00 00  f4 01 00 00 34 36 00 00  |DIR$........46..|
00003450  46 ff ff ff 5d 85 0c fb  59 01 00 00 13 00 00 00  |F...]...Y.......|
00003460  00 00 00 00 67 65 74 73  65 72 76 62 79 6e 61 6d  |....getservbynam|
00003470  65 00 00 00 90 37 00 00  46 ff ff ff 1c 75 0c fb  |e....7..F....u..|
00003480  f0 00 00 00 13 00 00 00  00 00 00 00 67 65 74 73  |............gets|
00003490  65 72 76 62 79 70 6f 72  74 00 00 00 80 38 00 00  |ervbyport....8..|
000034a0  46 ff ff ff ca 8c 0c fb  8d 00 00 00 13 00 00 00  |F...............|
000034b0  00 00 00 00 67 65 74 68  6f 73 74 62 79 6e 61 6d  |....gethostbynam|
000034c0  65 00 00 00 10 39 00 00  46 ff ff ff 4f 1e 0c fb  |e....9..F...O...|
000034d0  91 00 00 00 13 00 00 00  00 00 00 00 67 65 74 68  |............geth|
000034e0  6f 73 74 62 79 61 64 64  72 00 00 00 a4 39 00 00  |ostbyaddr....9..|
000034f0  47 ff ff ff 25 52 49 54  0d 01 00 00 13 00 00 00  |G...%RIT........|
00003500  00 00 00 00 63 72 65 61  74 65 73 65 72 76 6d 65  |....createservme|
00003510  6e 75 00 00 b4 3a 00 00  47 ff ff ff 0e d9 49 54  |nu...:..G.....IT|
00003520  7e 01 00 00 13 00 00 00  00 00 00 00 6d 74 72 65  |~...........mtre|
00003530  73 6f 6c 76 65 72 00 00  34 3c 00 00 47 ff ff ff  |solver..4<..G...|
00003540  e6 4f 4a 54 30 01 00 00  13 00 00 00 00 00 00 00  |.OJT0...........|
00003550  73 74 61 72 74 6d 74 67  65 74 68 6f 73 74 62 79  |startmtgethostby|
00003560  61 64 64 72 00 00 00 00  64 3d 00 00 47 ff ff ff  |addr....d=..G...|
00003570  86 5f 4a 54 2a 01 00 00  13 00 00 00 00 00 00 00  |._JT*...........|
00003580  73 74 61 72 74 6d 74 67  65 74 68 6f 73 74 62 79  |startmtgethostby|
00003590  6e 61 6d 65 00 00 00 00  90 3e 00 00 47 ff ff ff  |name.....>..G...|
000035a0  a3 8d 4a 54 46 01 00 00  13 00 00 00 00 00 00 00  |..JTF...........|
000035b0  63 68 65 63 6b 6d 74 71  75 65 72 79 00 00 00 00  |checkmtquery....|
000035c0  d8 3f 00 00 47 ff ff ff  08 b0 4a 54 cb 00 00 00  |.?..G.....JT....|
000035d0  13 00 00 00 00 00 00 00  6d 74 67 65 74 68 6f 73  |........mtgethos|
000035e0  74 62 79 6e 61 6d 65 00  a4 40 00 00 47 ff ff ff  |tbyname..@..G...|
000035f0  6f be 4a 54 d9 00 00 00  13 00 00 00 00 00 00 00  |o.JT............|
00003600  6d 74 67 65 74 68 6f 73  74 62 79 61 64 64 72 00  |mtgethostbyaddr.|
00003610  80 41 00 00 47 ff ff ff  90 cf d8 6b 95 00 00 00  |.A..G......k....|
00003620  13 00 00 00 00 00 00 00  64 65 63 6f 64 65 65 72  |........decodeer|
00003630  72 6f 72 00 44 41 54 41  59 01 00 00 46 4e 69 6e  |ror.DATAY...FNin|
00003640  65 74 5f 67 65 74 73 65  72 76 62 79 6e 61 6d 65  |et_getservbyname|
00003650  28 6e 61 6d 65 24 2c 70  72 6f 74 6f 24 29 0a 23  |(name$,proto$).#|
00003660  50 61 72 65 6e 74 20 21  52 6f 6f 74 0a 3d 3e 09  |Parent !Root.=>.|
00003670  7b 2f 7d 6e 61 6d 65 24  7b 2f 7d 09 6e 61 6d 65  |{/}name${/}.name|
00003680  20 6f 66 20 73 65 72 76  69 63 65 0a 09 7b 2f 7d  | of service..{/}|
00003690  70 72 6f 74 6f 24 7b 2f  7d 09 70 72 6f 74 6f 63  |proto${/}.protoc|
000036a0  6f 6c 20 74 6f 20 75 73  65 0a 3c 3d 09 6e 75 6d  |ol to use.<=.num|
000036b0  62 65 72 20 6f 66 20 70  6f 72 74 0a 0a 52 65 61  |ber of port..Rea|
000036c0  64 73 20 74 68 65 20 70  6f 72 74 20 6e 75 6d 62  |ds the port numb|
000036d0  65 72 20 77 68 69 63 68  20 70 72 6f 76 69 64 65  |er which provide|
000036e0  73 20 61 20 70 61 72 74  69 63 75 6c 61 72 20 73  |s a particular s|
000036f0  65 72 76 69 63 65 20 66  72 6f 6d 20 74 68 65 20  |ervice from the |
00003700  53 65 72 76 69 63 65 73  20 66 69 6c 65 20 69 6e  |Services file in|
00003710  20 74 68 65 20 21 49 6e  74 65 72 6e 65 74 20 72  | the !Internet r|
00003720  65 73 6f 75 72 63 65 2e  20 54 68 65 20 6f 6e 6c  |esource. The onl|
00003730  79 20 70 72 6f 74 6f 63  6f 6c 73 20 77 68 69 63  |y protocols whic|
00003740  68 20 68 61 76 65 20 61  6e 79 20 65 6e 74 72 69  |h have any entri|
00003750  65 73 20 61 72 65 20 74  63 70 20 61 6e 64 20 75  |es are tcp and u|
00003760  64 70 2e 0a 0a 4e 6f 74  65 3a 20 54 68 69 73 20  |dp...Note: This |
00003770  63 61 6e 20 74 61 6b 65  20 74 69 6d 65 20 75 6e  |can take time un|
00003780  64 65 72 20 46 72 65 65  4e 65 74 2e 0a 00 00 00  |der FreeNet.....|
00003790  44 41 54 41 f0 00 00 00  46 4e 69 6e 65 74 5f 67  |DATA....FNinet_g|
000037a0  65 74 73 65 72 76 62 79  70 6f 72 74 28 70 6f 72  |etservbyport(por|
000037b0  74 2c 70 72 6f 74 6f 24  29 0a 23 50 61 72 65 6e  |t,proto$).#Paren|
000037c0  74 20 21 52 6f 6f 74 0a  3d 3e 09 2f 70 6f 72 74  |t !Root.=>./port|
000037d0  2f 09 09 70 6f 72 74 20  6e 75 6d 62 65 72 0a 09  |/..port number..|
000037e0  7b 2f 7d 70 72 6f 74 6f  24 7b 2f 7d 09 70 72 6f  |{/}proto${/}.pro|
000037f0  74 6f 63 6f 6c 20 74 6f  20 75 73 65 0a 3c 3d 09  |tocol to use.<=.|
00003800  6e 61 6d 65 20 6f 66 20  73 65 72 76 69 63 65 0a  |name of service.|
00003810  0a 52 65 61 64 73 20 74  68 65 20 6e 61 6d 65 20  |.Reads the name |
00003820  6f 66 20 74 68 65 20 73  65 72 76 69 63 65 20 77  |of the service w|
00003830  68 69 63 68 20 69 73 20  70 72 6f 76 69 64 65 64  |hich is provided|
00003840  20 6f 6e 20 61 20 70 61  72 74 69 63 75 6c 61 72  | on a particular|
00003850  20 70 6f 72 74 2e 0a 0a  4e 6f 74 65 3a 20 54 68  | port...Note: Th|
00003860  69 73 20 63 61 6e 20 74  61 6b 65 20 74 69 6d 65  |is can take time|
00003870  20 75 6e 64 65 72 20 46  72 65 65 4e 65 74 2e 0a  | under FreeNet..|
00003880  44 41 54 41 8d 00 00 00  46 4e 69 6e 65 74 5f 67  |DATA....FNinet_g|
00003890  65 74 68 6f 73 74 62 79  6e 61 6d 65 28 68 6f 73  |ethostbyname(hos|
000038a0  74 24 29 0a 23 50 61 72  65 6e 74 20 21 52 6f 6f  |t$).#Parent !Roo|
000038b0  74 0a 3d 3e 09 7b 2f 7d  68 6f 73 74 24 7b 2f 7d  |t.=>.{/}host${/}|
000038c0  09 6e 61 6d 65 20 6f 66  20 68 6f 73 74 0a 3c 3d  |.name of host.<=|
000038d0  09 61 64 64 72 65 73 73  20 6f 66 20 68 6f 73 74  |.address of host|
000038e0  0a 0a 4c 6f 6f 6b 73 20  75 70 20 74 68 65 20 61  |..Looks up the a|
000038f0  64 64 72 65 73 73 20 6f  66 20 61 20 70 61 72 74  |ddress of a part|
00003900  69 63 75 6c 61 72 20 68  6f 73 74 2e 0a 00 00 00  |icular host.....|
00003910  44 41 54 41 91 00 00 00  46 4e 69 6e 65 74 5f 67  |DATA....FNinet_g|
00003920  65 74 68 6f 73 74 62 79  61 64 64 72 28 61 64 64  |ethostbyaddr(add|
00003930  72 65 73 73 29 0a 23 50  61 72 65 6e 74 20 21 52  |ress).#Parent !R|
00003940  6f 6f 74 0a 3d 3e 09 2f  61 64 64 72 65 73 73 2f  |oot.=>./address/|
00003950  09 61 64 64 72 65 73 73  20 6f 66 20 68 6f 73 74  |.address of host|
00003960  0a 3c 3d 09 6e 61 6d 65  20 6f 66 20 68 6f 73 74  |.<=.name of host|
00003970  0a 0a 4c 6f 6f 6b 73 20  75 70 20 74 68 65 20 6e  |..Looks up the n|
00003980  61 6d 65 20 6f 66 20 61  20 68 6f 73 74 20 66 72  |ame of a host fr|
00003990  6f 6d 20 69 74 27 73 20  61 64 64 72 65 73 73 2e  |om it's address.|
000039a0  0a 00 00 00 44 41 54 41  0d 01 00 00 46 4e 69 6e  |....DATA....FNin|
000039b0  65 74 5f 63 72 65 61 74  65 73 65 72 76 6d 65 6e  |et_createservmen|
000039c0  75 28 6e 61 6d 65 24 2c  70 72 6f 74 6f 24 29 0a  |u(name$,proto$).|
000039d0  23 50 61 72 65 6e 74 20  21 52 6f 6f 74 0a 3d 3e  |#Parent !Root.=>|
000039e0  09 7b 2f 7d 6e 61 6d 65  24 7b 2f 7d 09 6e 61 6d  |.{/}name${/}.nam|
000039f0  65 20 6f 66 20 73 65 72  76 69 63 65 20 74 6f 20  |e of service to |
00003a00  74 69 63 6b 2c 20 6f 72  20 6e 75 6c 6c 20 66 6f  |tick, or null fo|
00003a10  72 20 6e 6f 6e 65 0a 09  7b 2f 7d 70 72 6f 74 6f  |r none..{/}proto|
00003a20  24 7b 2f 7d 09 70 72 6f  74 6f 63 6f 6c 20 74 6f  |${/}.protocol to|
00003a30  20 75 73 65 2c 20 6f 72  20 6e 75 6c 6c 20 66 6f  | use, or null fo|
00003a40  72 20 64 65 66 61 75 6c  74 0a 3c 3d 09 70 6f 69  |r default.<=.poi|
00003a50  6e 74 65 72 20 74 6f 20  6d 65 6e 75 20 73 74 72  |nter to menu str|
00003a60  75 63 74 75 72 65 0a 0a  43 72 65 61 74 65 73 20  |ucture..Creates |
00003a70  61 20 6d 65 6e 75 20 73  74 72 75 63 74 75 72 65  |a menu structure|
00003a80  20 66 6f 72 20 61 6c 6c  20 74 68 65 20 73 65 72  | for all the ser|
00003a90  76 69 63 65 73 2c 20 74  69 63 6b 69 6e 67 20 74  |vices, ticking t|
00003aa0  68 65 20 73 65 6c 65 63  74 65 64 20 6f 6e 65 2e  |he selected one.|
00003ab0  0a 00 00 00 44 41 54 41  7e 01 00 00 46 4e 69 6e  |....DATA~...FNin|
00003ac0  65 74 5f 6d 74 72 65 73  6f 6c 76 65 72 0a 23 50  |et_mtresolver.#P|
00003ad0  61 72 65 6e 74 20 21 52  6f 6f 74 0a 3c 3d 09 54  |arent !Root.<=.T|
00003ae0  52 55 45 20 69 66 20 74  68 65 72 65 20 69 73 20  |RUE if there is |
00003af0  61 20 6d 75 6c 74 69 74  61 73 6b 69 6e 67 20 72  |a multitasking r|
00003b00  65 73 6f 6c 76 65 72 20  70 72 65 73 65 6e 74 0a  |esolver present.|
00003b10  0a 43 68 65 63 6b 73 20  66 6f 72 20 74 68 65 20  |.Checks for the |
00003b20  70 72 65 73 65 6e 63 65  20 6f 66 20 61 20 6d 75  |presence of a mu|
00003b30  6c 74 69 74 61 73 6b 69  6e 67 20 72 65 73 6f 6c  |ltitasking resol|
00003b40  76 65 72 2e 20 49 66 20  74 68 69 73 20 64 6f 65  |ver. If this doe|
00003b50  73 20 6e 6f 74 20 72 65  74 75 72 6e 20 54 52 55  |s not return TRU|
00003b60  45 20 79 6f 75 20 73 68  6f 75 6c 64 20 4e 4f 54  |E you should NOT|
00003b70  20 63 61 6c 6c 20 74 68  65 20 66 6f 6c 6c 6f 77  | call the follow|
00003b80  69 6e 67 20 72 6f 75 74  69 6e 65 73 20 3a 0a 23  |ing routines :.#|
00003b90  49 6e 64 65 6e 74 20 32  0a 3c 46 4e 69 6e 65 74  |Indent 2.<FNinet|
00003ba0  5f 73 74 61 72 74 6d 74  67 65 74 68 6f 73 74 62  |_startmtgethostb|
00003bb0  79 6e 61 6d 65 3e 0a 3c  46 4e 69 6e 65 74 5f 73  |yname>.<FNinet_s|
00003bc0  74 61 72 74 6d 74 67 65  74 68 6f 73 74 62 79 61  |tartmtgethostbya|
00003bd0  64 64 72 3e 0a 3c 46 4e  69 6e 65 74 5f 63 68 65  |ddr>.<FNinet_che|
00003be0  63 6b 6d 74 71 75 65 72  79 3e 0a 3c 46 4e 69 6e  |ckmtquery>.<FNin|
00003bf0  65 74 5f 6b 69 6c 6c 6d  74 71 75 65 72 79 3e 0a  |et_killmtquery>.|
00003c00  3c 46 4e 69 6e 65 74 5f  6d 74 67 65 74 68 6f 73  |<FNinet_mtgethos|
00003c10  74 62 79 6e 61 6d 65 3e  0a 3c 46 4e 69 6e 65 74  |tbyname>.<FNinet|
00003c20  5f 6d 74 67 65 74 68 6f  73 74 62 79 61 64 64 72  |_mtgethostbyaddr|
00003c30  3e 0a 00 00 44 41 54 41  30 01 00 00 46 4e 69 6e  |>...DATA0...FNin|
00003c40  65 74 5f 73 74 61 72 74  6d 74 67 65 74 68 6f 73  |et_startmtgethos|
00003c50  74 62 79 61 64 64 72 28  61 64 64 72 29 0a 23 50  |tbyaddr(addr).#P|
00003c60  61 72 65 6e 74 20 21 52  6f 6f 74 0a 3d 3e 09 7b  |arent !Root.=>.{|
00003c70  2f 7d 61 64 64 72 7b 2f  7d 09 61 64 64 72 65 73  |/}addr{/}.addres|
00003c80  73 20 74 6f 20 72 65 73  6f 6c 76 65 72 0a 3c 3d  |s to resolver.<=|
00003c90  09 68 61 6e 64 6c 65 20  6f 66 20 6c 6f 6f 6b 75  |.handle of looku|
00003ca0  70 2c 20 6f 72 20 30 20  69 66 20 63 61 6c 6c 20  |p, or 0 if call |
00003cb0  66 61 69 6c 65 64 0a 0a  53 74 61 72 74 73 20 61  |failed..Starts a|
00003cc0  20 6d 75 6c 74 69 74 61  73 6b 69 6e 67 20 6c 6f  | multitasking lo|
00003cd0  6f 6b 75 70 20 6f 66 20  61 20 68 6f 73 74 20 62  |okup of a host b|
00003ce0  79 20 69 74 27 73 20 61  64 64 72 65 73 73 2e 20  |y it's address. |
00003cf0  55 73 65 20 3c 46 4e 69  6e 65 74 5f 63 68 65 63  |Use <FNinet_chec|
00003d00  6b 6d 74 71 75 65 72 79  3e 20 74 6f 20 66 69 6e  |kmtquery> to fin|
00003d10  64 20 74 68 65 20 63 75  72 72 65 6e 74 20 73 74  |d the current st|
00003d20  61 74 65 20 6f 66 20 74  68 65 20 6c 6f 6f 6b 75  |ate of the looku|
00003d30  70 2c 20 61 6e 64 20 3c  46 4e 69 6e 65 74 5f 6d  |p, and <FNinet_m|
00003d40  74 67 65 74 68 6f 73 74  62 79 61 64 64 72 3e 20  |tgethostbyaddr> |
00003d50  74 6f 20 72 65 61 64 20  74 68 65 20 72 65 73 75  |to read the resu|
00003d60  6c 74 2e 0a 44 41 54 41  2a 01 00 00 46 4e 69 6e  |lt..DATA*...FNin|
00003d70  65 74 5f 73 74 61 72 74  6d 74 67 65 74 68 6f 73  |et_startmtgethos|
00003d80  74 62 79 6e 61 6d 65 28  68 6f 73 74 24 29 0a 23  |tbyname(host$).#|
00003d90  50 61 72 65 6e 74 20 21  52 6f 6f 74 0a 3d 3e 09  |Parent !Root.=>.|
00003da0  7b 2f 7d 68 6f 73 74 24  7b 2f 7d 09 68 6f 73 74  |{/}host${/}.host|
00003db0  20 74 6f 20 6c 6f 6f 6b  75 70 0a 3c 3d 09 68 61  | to lookup.<=.ha|
00003dc0  6e 64 6c 65 20 6f 66 20  6c 6f 6f 6b 75 70 2c 20  |ndle of lookup, |
00003dd0  6f 72 20 30 20 69 66 20  63 61 6c 6c 20 66 61 69  |or 0 if call fai|
00003de0  6c 65 64 0a 0a 53 74 61  72 74 73 20 61 20 6d 75  |led..Starts a mu|
00003df0  6c 74 69 74 61 73 6b 69  6e 67 20 6c 6f 6f 6b 75  |ltitasking looku|
00003e00  70 20 6f 66 20 61 20 68  6f 73 74 20 62 79 20 69  |p of a host by i|
00003e10  74 27 73 20 6e 61 6d 65  2e 20 55 73 65 20 3c 46  |t's name. Use <F|
00003e20  4e 69 6e 65 74 5f 63 68  65 63 6b 6d 74 71 75 65  |Ninet_checkmtque|
00003e30  72 79 3e 20 74 6f 20 66  69 6e 64 20 74 68 65 20  |ry> to find the |
00003e40  63 75 72 72 65 6e 74 20  73 74 61 74 65 20 6f 66  |current state of|
00003e50  20 74 68 65 20 6c 6f 6f  6b 75 70 2c 20 61 6e 64  | the lookup, and|
00003e60  20 3c 46 4e 69 6e 65 74  5f 6d 74 67 65 74 68 6f  | <FNinet_mtgetho|
00003e70  73 74 62 79 6e 61 6d 65  3e 20 74 6f 20 72 65 61  |stbyname> to rea|
00003e80  64 20 74 68 65 20 72 65  73 75 6c 74 2e 0a 00 00  |d the result....|
00003e90  44 41 54 41 46 01 00 00  46 4e 69 6e 65 74 5f 63  |DATAF...FNinet_c|
00003ea0  68 65 63 6b 6d 74 71 75  65 72 79 28 68 61 6e 64  |heckmtquery(hand|
00003eb0  6c 65 29 0a 23 50 61 72  65 6e 74 20 21 52 6f 6f  |le).#Parent !Roo|
00003ec0  74 0a 3d 3e 09 7b 2f 7d  68 61 6e 64 6c 65 7b 2f  |t.=>.{/}handle{/|
00003ed0  7d 09 68 61 6e 64 6c 65  20 72 65 74 75 72 6e 65  |}.handle returne|
00003ee0  64 20 62 79 20 6f 6e 65  20 6f 66 20 74 68 65 20  |d by one of the |
00003ef0  46 4e 69 6e 65 74 5f 73  74 61 72 74 2e 2e 2e 20  |FNinet_start... |
00003f00  63 61 6c 6c 73 0a 3c 3d  09 54 52 55 45 20 69 66  |calls.<=.TRUE if|
00003f10  20 6c 6f 6f 6b 75 70 20  68 61 73 20 73 75 63 63  | lookup has succ|
00003f20  65 65 64 65 64 2c 0a 09  46 41 4c 53 45 20 69 66  |eeded,..FALSE if|
00003f30  20 6c 6f 6f 6b 75 70 20  68 61 73 20 66 61 69 6c  | lookup has fail|
00003f40  65 64 2c 0a 09 31 20 69  73 20 6c 6f 6f 6b 75 70  |ed,..1 is lookup|
00003f50  20 69 73 20 73 74 69 6c  6c 20 67 6f 69 6e 67 0a  | is still going.|
00003f60  0a 43 68 65 63 6b 73 20  74 68 65 20 73 74 61 74  |.Checks the stat|
00003f70  65 20 6f 66 20 61 20 6d  75 6c 74 69 74 61 73 6b  |e of a multitask|
00003f80  69 6e 67 20 6c 6f 6f 6b  75 70 20 73 74 61 72 74  |ing lookup start|
00003f90  65 64 20 62 79 20 3c 46  4e 69 6e 65 74 5f 73 74  |ed by <FNinet_st|
00003fa0  61 72 74 6d 74 67 65 74  68 6f 73 74 62 79 6e 61  |artmtgethostbyna|
00003fb0  6d 65 3e 20 6f 72 20 3c  46 4e 69 6e 65 74 5f 73  |me> or <FNinet_s|
00003fc0  74 61 72 74 6d 74 67 65  74 68 6f 73 74 62 79 61  |tartmtgethostbya|
00003fd0  64 64 72 3e 2e 0a 00 00  44 41 54 41 cb 00 00 00  |ddr>....DATA....|
00003fe0  46 4e 69 6e 65 74 5f 6d  74 67 65 74 68 6f 73 74  |FNinet_mtgethost|
00003ff0  62 79 6e 61 6d 65 28 68  61 6e 64 6c 65 29 0a 23  |byname(handle).#|
00004000  50 61 72 65 6e 74 20 21  52 6f 6f 74 0a 3d 3e 09  |Parent !Root.=>.|
00004010  7b 2f 7d 68 61 6e 64 6c  65 7b 2f 7d 09 68 61 6e  |{/}handle{/}.han|
00004020  64 6c 65 20 72 65 74 75  72 6e 65 64 20 62 79 20  |dle returned by |
00004030  3c 46 4e 69 6e 65 74 5f  73 74 61 72 74 6d 74 67  |<FNinet_startmtg|
00004040  65 74 68 6f 73 74 62 79  6e 61 6d 65 3e 0a 3c 3d  |ethostbyname>.<=|
00004050  09 49 50 20 6f 66 20 68  6f 73 74 20 69 66 20 66  |.IP of host if f|
00004060  6f 75 6e 64 2c 20 30 20  6f 74 68 65 72 77 69 73  |ound, 0 otherwis|
00004070  65 0a 0a 52 65 61 64 73  20 74 68 65 20 72 65 73  |e..Reads the res|
00004080  75 6c 74 20 6f 66 20 61  20 6d 75 6c 74 69 74 61  |ult of a multita|
00004090  73 6b 69 6e 67 20 6e 61  6d 65 20 6c 6f 6f 6b 75  |sking name looku|
000040a0  70 2e 0a 00 44 41 54 41  d9 00 00 00 46 4e 69 6e  |p...DATA....FNin|
000040b0  65 74 5f 6d 74 67 65 74  68 6f 73 74 62 79 61 64  |et_mtgethostbyad|
000040c0  64 72 28 68 61 6e 64 6c  65 29 0a 23 50 61 72 65  |dr(handle).#Pare|
000040d0  6e 74 20 21 52 6f 6f 74  0a 3d 3e 09 7b 2f 7d 68  |nt !Root.=>.{/}h|
000040e0  61 6e 64 6c 65 7b 2f 7d  09 68 61 6e 64 6c 65 20  |andle{/}.handle |
000040f0  72 65 74 75 72 6e 65 64  20 62 79 20 3c 46 4e 69  |returned by <FNi|
00004100  6e 65 74 5f 73 74 61 72  74 6d 74 67 65 74 68 6f  |net_startmtgetho|
00004110  73 74 62 79 61 64 64 72  3e 0a 3c 3d 09 6e 61 6d  |stbyaddr>.<=.nam|
00004120  65 20 6f 66 20 68 6f 73  74 20 69 66 20 66 6f 75  |e of host if fou|
00004130  6e 64 2c 20 6f 72 20 6e  75 6c 6c 20 69 66 20 6e  |nd, or null if n|
00004140  6f 74 20 66 6f 75 6e 64  0a 0a 52 65 61 64 73 20  |ot found..Reads |
00004150  74 68 65 20 72 65 73 75  6c 74 20 6f 66 20 61 20  |the result of a |
00004160  6d 75 6c 74 69 74 61 73  6b 69 6e 67 20 61 64 64  |multitasking add|
00004170  72 65 73 73 20 6c 6f 6f  6b 75 70 2e 0a 00 00 00  |ress lookup.....|
00004180  44 41 54 41 95 00 00 00  46 4e 69 6e 65 74 5f 64  |DATA....FNinet_d|
00004190  65 63 6f 64 65 65 72 72  6f 72 28 65 72 72 6f 72  |ecodeerror(error|
000041a0  29 0a 23 50 61 72 65 6e  74 20 21 52 6f 6f 74 0a  |).#Parent !Root.|
000041b0  3d 3e 09 7b 2f 7d 65 72  72 6f 72 7b 2f 7d 09 65  |=>.{/}error{/}.e|
000041c0  72 72 6f 72 20 6e 75 6d  62 65 72 0a 3c 3d 09 74  |rror number.<=.t|
000041d0  65 78 74 75 61 6c 20 65  72 72 6f 72 20 6d 65 73  |extual error mes|
000041e0  73 61 67 65 0a 0a 52 65  61 64 73 20 74 68 65 20  |sage..Reads the |
000041f0  74 65 78 74 75 61 6c 20  76 65 72 73 69 6f 6e 20  |textual version |
00004200  6f 66 20 61 6e 20 65 72  72 6f 72 20 6d 65 73 73  |of an error mess|
00004210  61 67 65 2e 0a 00 00 00  44 49 52 24 30 00 00 00  |age.....DIR$0...|
00004220  30 00 00 00 48 42 00 00  47 ff ff ff b0 87 08 61  |0...HB..G......a|
00004230  88 00 00 00 13 00 00 00  00 00 00 00 6f 70 65 6e  |............open|
00004240  73 65 73 73 69 6f 6e 00  44 41 54 41 88 00 00 00  |session.DATA....|
00004250  46 4e 6c 6f 67 5f 6f 70  65 6e 73 65 73 73 69 6f  |FNlog_opensessio|
00004260  6e 28 6c 65 76 65 6c 29  0a 23 50 61 72 65 6e 74  |n(level).#Parent|
00004270  20 21 52 6f 6f 74 0a 3d  3e 09 7b 2f 7d 6c 65 76  | !Root.=>.{/}lev|
00004280  65 6c 7b 2f 7d 09 3c 70  72 69 6f 72 69 74 79 3d  |el{/}.<priority=|
00004290  3e 53 57 49 3a 53 79 73  4c 6f 67 5f 70 72 69 6f  |>SWI:SysLog_prio|
000042a0  72 69 74 69 65 73 3e 0a  3c 3d 09 73 65 73 73 69  |rities>.<=.sessi|
000042b0  6f 6e 20 68 61 6e 64 6c  65 0a 0a 4f 70 65 6e 73  |on handle..Opens|
000042c0  20 61 20 73 65 73 73 69  6f 6e 20 6c 6f 67 2e 0a  | a session log..|
000042d0