Janus Sockets $functions: Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 20: Line 20:
distributed with this product.
distributed with this product.
   
   
==<var class="product">Janus Sockets</var> $function summary==
==Janus Sockets $function summary==
The <var class="product">Janus Sockets</var> <var class="product">User Language</var> $functions for communicating with remote
The <var class="product">Janus Sockets</var> <var class="product">User Language</var> $functions for communicating with remote
hosts over TCP/IP are listed below and described individually in
hosts over TCP/IP are listed below and described individually in
sections that follow:
sections that follow:
<table>
<table>
<tr><th>$Sock_Capture
<tr><th>[[$Sock_Capture]]
</th><td>Change print capture setting
</th><td>Change print capture setting
</td></tr>
</td></tr>
<tr><th>$Sock_Cert_Info
<tr><th>[[$Sock_Cert_Info]]
</th><td>Get value of entity in partner's certificate
</th><td>Get value of entity in partner's certificate
</td></tr>
</td></tr>
<tr><th>$Sock_Cert_Levels
<tr><th>[[$Sock_Cert_Levels]]
</th><td>Get number of levels in partner's certificate
</th><td>Get number of levels in partner's certificate
</td></tr>
</td></tr>
<tr><th>$Sock_Close
<tr><th>[[$Sock_Close]]
</th><td>Terminate sending and receiving of data on, and remove from use, one or all <var class="product">Janus Sockets</var> connection(s)
</th><td>Terminate sending and receiving of data on, and remove from use, one or all <var class="product">Janus Sockets</var> connection(s)
</td></tr>
</td></tr>
<tr><th>$Sock_Conn
<tr><th>[[$Sock_Conn]]
</th><td>Create connection to remote host using CLSOCK port
</th><td>Create connection to remote host using CLSOCK port
</td></tr>
</td></tr>
<tr><th>$Sock_ErrInfo
<tr><th>[[$Sock_ErrInfo]]
</th><td>Get info about last <var class="product">Janus Sockets</var> error
</th><td>Get info about last <var class="product">Janus Sockets</var> error
</td></tr>
</td></tr>
<tr><th>$Sock_Info
<tr><th>[[$Sock_Info]]
</th><td>Get info about socket
</th><td>Get info about socket
</td></tr>
</td></tr>
<tr><th>$Sock_Num
<tr><th>[[$Sock_Num]]
</th><td>Get selected socket numbers
</th><td>Get selected socket numbers
</td></tr>
</td></tr>
<tr><th>$Sock_OnReset
<tr><th>[[$Sock_OnReset]]
</th><td>Set label to handle <var>RESET</var> conditions
</th><td>Set label to handle <var>RESET</var> conditions
</td></tr>
</td></tr>
<tr><th>$Sock_Recv
<tr><th>[[$Sock_Recv]]
</th><td>Receive string based on count
</th><td>Receive string based on count
</td></tr>
</td></tr>
<tr><th>$Sock_RecvPrs
<tr><th>[[$Sock_RecvPrs]]
</th><td>Receive parsed string
</th><td>Receive parsed string
</td></tr>
</td></tr>
<tr><th>$Sock_Send
<tr><th>[[$Sock_Send]]
</th><td>Send string
</th><td>Send string
</td></tr>
</td></tr>
<tr><th>$Sock_SendLn
<tr><th>[[$Sock_SendLn]]
</th><td>Send string followed by <var>LINEND</var>
</th><td>Send string followed by <var>LINEND</var>
</td></tr>
</td></tr>
<tr><th>$Sock_Set
<tr><th>[[$Sock_Set]]
</th><td>Change parameter or setting on one or all sockets
</th><td>Change parameter or setting on one or all sockets
</td></tr>
</td></tr>
<tr><th>$Sock_SSL_On
<tr><th>[[$Sock_SSL_On]]
</th><td>Switch to SSL processing on a socket
</th><td>Switch to SSL processing on a socket
</td></tr>
</td></tr>
<tr><th>$Sock_Tran_In
<tr><th>[[$Sock_Tran_In]]
</th><td>Translate string, from character set of remote, to local internal character set ("EBCDIC")
</th><td>Translate string, from character set of remote, to local internal character set ("EBCDIC")
</td></tr>
</td></tr>
<tr><th>$Sock_Tran_Out
<tr><th>[[$Sock_Tran_Out]]
</th><td>Translate string, from local internal character set ("EBCDIC"), to character set of remote
</th><td>Translate string, from local internal character set ("EBCDIC"), to character set of remote
</td></tr>
</td></tr>
<tr><th>$Sock_URL_Encode
<tr><th>[[$Sock_URL_Encode]]
</th><td>Encode special characters into the URL "% hex hex" format
</th><td>Encode special characters into the URL "% hex hex" format
</td></tr>
</td></tr>
<tr><th>Print operations
<tr><th>Print operations
</th><td>In addition to the above list of $functions, data may be sent over a socket as the result of a "print" operation. This is accomplished by the <var>[[$Sock_Capture]]</var> function. Note that print operations outside a <var class="product">User Language</var> request can be captured as well, if a capturing socket has the <var>NOCLOSE</var> setting.
</th><td>In addition to the above list of $functions, data may be sent over a socket as the result of a "print" operation. This is accomplished by the <var>$Sock_Capture</var> function. Note that print operations outside a <var class="product">User Language</var> request can be captured as well, if a capturing socket has the <var>NOCLOSE</var> setting.
   
   
For example, the <var>DISPLAY</var> command, and the <var class="product">User Language</var> <var>Print</var> statement and <var>[[Text and Html statements|Html]]</var> statement block are all print operations;
For example, the <var>DISPLAY</var> command, and the <var class="product">User Language</var> <var>Print</var> statement and <var>[[Text and Html statements|Html]]</var> statement block are all print operations;

Revision as of 15:39, 6 June 2012

The User Language sockets API is implemented as the Janus Sockets $function set. The Janus SOAP Socket, HTTP Helper, Email, and LDAP objects and methods are alternatives that generalize the Janus Sockets $functions and are designed to be easier to use. These $functions and object methods provide User Language programs with the ability to receive and send using socket ports.

This topic is primarily concerned with how to use the individual $functions, though much of its text applies as well to the Socket object methods that are largely analogous to the $functions.

There are a few restrictions on the order in which the Janus Sockets $functions are used: for example, a socket port must be connected before data is sent using it, and data may not be sent after the FIN indicator is sent. For more information about Janus Sockets programming, see "Janus Sockets User Language coding considerations".

Sample programs using $functions are included in the appendix to this document and in the JANUS file distributed with this product.

Janus Sockets $function summary

The Janus Sockets User Language $functions for communicating with remote hosts over TCP/IP are listed below and described individually in sections that follow:

$Sock_Capture Change print capture setting
$Sock_Cert_Info Get value of entity in partner's certificate
$Sock_Cert_Levels Get number of levels in partner's certificate
$Sock_Close Terminate sending and receiving of data on, and remove from use, one or all Janus Sockets connection(s)
$Sock_Conn Create connection to remote host using CLSOCK port
$Sock_ErrInfo Get info about last Janus Sockets error
$Sock_Info Get info about socket
$Sock_Num Get selected socket numbers
$Sock_OnReset Set label to handle RESET conditions
$Sock_Recv Receive string based on count
$Sock_RecvPrs Receive parsed string
$Sock_Send Send string
$Sock_SendLn Send string followed by LINEND
$Sock_Set Change parameter or setting on one or all sockets
$Sock_SSL_On Switch to SSL processing on a socket
$Sock_Tran_In Translate string, from character set of remote, to local internal character set ("EBCDIC")
$Sock_Tran_Out Translate string, from local internal character set ("EBCDIC"), to character set of remote
$Sock_URL_Encode Encode special characters into the URL "% hex hex" format
Print operations In addition to the above list of $functions, data may be sent over a socket as the result of a "print" operation. This is accomplished by the $Sock_Capture function. Note that print operations outside a User Language request can be captured as well, if a capturing socket has the NOCLOSE setting.

For example, the DISPLAY command, and the User Language Print statement and Html statement block are all print operations; if they are invoked while print is captured to one or more sockets, their output lines are sent to the sockets. A print line is sent followed by the socket's current LINEND value, if any. See "Print capturing hierarchy and other considerations" and "Print capturing example".