15. Submitting Jobs via the Socket Reader

15.1 Socket Reader Basics

The “sockdev” option allows you to submit cards directly to a Hercules card reader from outside of
Hercules. The card reader must be defined with the “sockdev” keyword and either a TCP/IP port number
or the name of a Unix Domain Socket. Then whenever you want to submit a card deck to that particular
card reader, you use an external program to connect to the socket and transmit the cards to the reader.
Socket readers were implemented by Fish, based upon code originally contributed by Malcolm Beattie.

Socket readers are defined in the Hercules configuration like this:

Descriptive

sockspec [option [option ... ]]

Diagram

Êʬ¬¬ ¬¬¬
¬¬¬ sockspec ¬¬¬ ¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬Ê





ʬ¬¬§¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬§¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬ÊÍ




option

Parameters devnum, devtype and the keyword SOCKDEV are the same as described in chapter

6.5
(“Card Reader Devices”).

The socket specification sockspec can take any of the following formats:

ipaddr:port

The reader listens on the specific IP address and port number. ipaddr must be The
IP address of an interface on the local system.

For example, “127.0.0.1:1234” is used to accept only jobs submitted locally via the
loopback interface.

hostname:port

Similar to the previous example, where hostname must resolve to an IP address
belonging to the local system.

Example: “localhost:1234”.

port

The reader listens on the specified port number and accepts jobs submitted from
any IP address defined on the local system.

Example: “1234”.

path/name

The reader listens on the specified Unix Domain Socket.

Example: “/tmp/hercrdr.00C”

Examples:

000A 2501 127.0.0.1:2501 SOCKDEV ASCII TRUNC EOF

000C 3505 localhost:1234 SOCKDEV ASCII TRUNC EOF

0012 3505 3505 SOCKDEV ASCII TRUNC EOF

0014 2501 /tmp/hercrdr.014 SOCKDEV ASCII TRUNC EOF

15.2 Submitting Jobs from Windows

The “HercRdr” program is distributed as part of Fish’s GUI package and allows you to send jobs to a
socket reader via TCP/IP. Simply enter “HercRdr” from the command line (i.e. from a “Command Prompt”
window if you are using Windows NT / 2K / XP) to submit your file(s).

The following screen print shows the help information from the HercRdr program that is displayed
whenever the program is called without parameters:

D:\HERCULES>hercrdr

Submits card file(s) to a Hercules card reader bound to a given socket:port.

Format:

HERCRDR [-nnn] [host:port] file [file...]

Where:

-nnn timeout value in seconds (1-999; default is 3)

host:port sock_spec of target reader (if not specified,

value of HERCRDR environ var is used, if set)

file file(s) to be submitted

Examples:

HERCRDR localhost:1234 fileone.txt filetwo.txt

set HERCRDR=localhost:1234

HERCRDR file3.txt file4.txt

HERCRDR override:5678 filefive.txt

HERCRDR 192.168.0.1:5678 666.txt 777.txt 888.txt 999.txt

Returns:

-1 unclassified error

0 file(s) successfully submitted

1 no route to host (bad sock_spec or connection refused)

2 timeout value exceeded while trying to connect

3 transmission error (e.g. connection prematurely closed)

4 file not found (or other file error)

Figure 352: HercRdr Help Screen

Previous Page Next Page