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
(“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”

 
            



















































































































































































































































































































































































































































































































































































































































































