Please enable JavaScript to view this site.

A-Shell Development History

Navigation: Version 4.6, builds 699-791

758 — 8 December 2000

Scroll Prev Top Next More

1. Various enhancements to TCPCLI.SBR & TCPSRV.SBR...

 

A: Add an optional FLAGS parameter:

 

 XCALL TCPCLI,CODE,STATUS,REC,SOCKPORT,HOSTNAME {,FLAGS}        XCALL TCPSRV,CODE,STATUS,REC,SOCKET {,FLAGS}

 

For the OPEN operation, FLAGS may be used to control whether a READ operation blocks or not. Set FLAGS=1 for blocking, or 0 for non-blocking. The default for TCPSRV is non-blocking and for TCPCLI is blocking.

 

For the WRITE operation, FLAGS may contain the number of bytes to write (up to a maximum of the REC size.) Previously, the entire contents of REC was always sent.

 

For the CHECK operation, FLAGS may contain the number of seconds to wait before returning with a no-data-available status. This can be a fractional number, like 0.5 seconds, although the actual time of the wait will be surely be larger due to scheduling latency.

 

B. The CHECK operation is now available in TCPCLI as well as TCPSRV.

 

NOTES: TCPSRV & TCPCLI were introduced in edit 672--see the notes in update45.txt for basic documentation.

 

TIPS: A non-blocking read operation will return STATUS -11 (resource temporarily unavailable) if there is nothing to read. A blocking read operation will return with STATUS=0 if the other side closes the connection. (This may be the only indication you get that the other side was closed.) When implementing a simple server which services a request quickly and then closes the connection and listens for another, the recommended sequence is for the server to go into a blocking read and wait for the client to close the connection (which will cause the server's read to abort with STATUS 0.) The server can then close its connection and immediately go back to opening another.

 

C. The server's connection backlog has been increased from 1 to 5 connections waiting to be serviced.

 

2. XCALL MIAMEX,86,ERRNO,MSG can now be used to retrieve the operating system error description for the given errno. This is useful in conjunction with routines like TCPSRV/TCPCLI which actually return you the system errno values. Note that the system errno numeric value for a given condition may vary between operation systems.

 

3. Fix a problem XCALL AMOS,"ORUN ..." with OPTIONS=AMOS_RUNSBR. It was failing to execute the subroutine at all in some cases. The problem did not occur when specifying RUN instead of ORUN or when OPTIONS=AMOS_RUNSBR was not specified.

 

4. ASTAT.LIT 2.2(128) supports several new switches:

 

 ASTAT /C        - display device (console) instead of user name        ASTAT /S        - sort by job name        ASTAT /SU        - sort by user name (or console name if /C)        ASTAT /SP        - sort by program name