Use with to obtain interactive access to the package procedures.
| (1) |
Find out where you are on the network.
| (2) |
Open a connection to the echo server on the peer (a particular machine on the same network as the machine that generated this help page).
>
|
|
Send a message to the peer.
>
|
|
Read back the response.
| (5) |
Shut down the connection.
The following program finger enables you to make a query by using the finger protocol.
>
|
finger := proc( _who )
local who, at, host, sock;
who := _who;
at := StringTools:-FirstFromLeft( "@", who );
if at <> FAIL then
host := who[ 1 + at .. -1 ];
who := who[ 1 .. at - 1 ]
else
host := "localhost"
end if;
use Sockets in
sock := Open( host, finger );
Write( sock, sprintf( "%s\r\n", who ) );
printf( "%s\n", Read( sock, 5 ) );
Close( sock )
end use;
NULL
end proc:
|