Changes between Initial Version and Version 1 of export_ack


Ignore:
Timestamp:
02/29/12 15:49:11 (10 years ago)
Author:
branden
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • export_ack

    v1 v1  
     1[[PageOutline]] 
     2 
     3= [wiki:Earthworm Earthworm] Module: export_ack= 
     4'''Contributed by: ''' 
     5 
     6== Function == 
     7Exports EARTHWORM messages over Internet (partner to import_generic).  
     8 
     9== Details == 
     10[wiki:Import-Export Import-Export Overview] 
     11 
     12=== EXAMPLE CONFIGURATION FILE === 
     13{{{ 
     14# 
     15# export_ack configuration file 
     16# 
     17# Export_ack expects to receive an acknowledgment packet for every 
     18# packet that is writes to socket. It keeps a SendQueue of messages it has 
     19# sent and their status. The SocketSend thread will not re-use a slot in 
     20# its SendQueue until the SocketRecv thread has marked that slot as ACKed. 
     21# 
     22# Import/Export send heartbeats to each other, as well as into their 
     23# local earthworm systems. If the socket heartbeat from the distant partner 
     24# is not received whithin the expected time period (RcvAliveInt) the link is 
     25# terminated, and an attempt to reconnect is initiated. If things go 
     26# seriously wrong, the heartbeat into the local earthworm system in 
     27# stopped. The expectation is that "restartMe" has been set in the .desc 
     28# file, and we'll be killed and restarted. 
     29# 
     30# Socket heartbeats are not put in either the message stacking queue 
     31# or in the SendQueue, so they do not take up precious space when 
     32# the connection between import/export is down. 
     33# 
     34# All socket operations are performed with a timeout. This is noramlly 
     35# defaulted, but can be set in this file (SocketTimeout). 
     36# 
     37# Export maintains a circular FIFO buffer of messages to be shipped.  
     38# Let's call this the MessageStacking queue. The depth of this queue  
     39# (RingSize) controls the maximum latency of the data. 
     40# 
     41# 
     42# Configuration notes: 
     43# 
     44# "restartMe" should be uncommented in my .desc file. 
     45# 
     46# The period of our local heartbeat (HeartBeatInt) must be safely smaller 
     47# (faster) than our advertised period in our .desc file (tsec:). 
     48# Otherwise we'll get continually restarted for no good reason. 
     49# Note that tsec:0 implies no heartbeats expected, and so we'll never get 
     50# restarted. 
     51# 
     52# The rate at which we send socket heartbeats to our distant partner should 
     53# be considerably faster than the rate at which our partner expects them. 
     54# Otherwise, a heartbeat delayed in transmission will cause our partner to 
     55# conclude that the link is broken, and cause them to break the link and 
     56# reinitialize. Which will cause us to do the same. 
     57# 
     58# For export, the ServerIPAdr is the address of the port to be used in 
     59# the exporting machine.  This is to specify a network card case the 
     60# exporting machine has several network cards.   
     61# Using ServerIPAdr 0.0.0.0 will allow export to answer connections 
     62# on any valid address of the machine. 
     63# 
     64# If SocketTimeout is specified, it should be at least as large as the 
     65# expected period of heartbeats from our distant partner. 
     66 
     67# Basic Earthworm setup 
     68#---------------------- 
     69 MyModuleId     MOD_EXPORT_ACK      # module id for this program 
     70 RingName       PICK_RING           # transport ring to use for input/output 
     71 HeartBeatInt   30                  # EW internal heartbeat interval (sec) 
     72                                    #   Should be >= RcvAliveInt 
     73# Logging Control 
     74#---------------- 
     75 LogFile        1      # If 0, don't write logfile 
     76                       #    1, write to logfile and stdout 
     77                       #    2, write to module log but not stderr/stdout 
     78#Verbose               # If uncommented, VERY LARGE logfiles will be  
     79                       #   generated with info about queue status of  
     80                       #   each msg, socket alive msgs sent & received. 
     81 
     82# Logos of messages to export to client systems 
     83#---------------------------------------------- 
     84#              Installation       Module       Message Type 
     85 GetMsgLogo    INST_UNKNOWN     MOD_WILDCARD     TYPE_PICK2K 
     86 GetMsgLogo    INST_UNKNOWN     MOD_WILDCARD     TYPE_CODA2K 
     87 
     88# Set up Message Queues  
     89# Note: socket "alive" messages are not put in either queue 
     90#----------------------------------------------------------  
     91 MaxMsgSize             4096   # maximum size (bytes) for input/output msgs 
     92 RingSize                200   # number of msgs in MessageStacking queue. 
     93                               #  (msgs waiting to be sent to socket) 
     94 SendQueueLength         100   # Optional command: #msgs in SendQueue 
     95                               #  (msgs sent, acknowledgments pending) 
     96                               #  Valid range: 1-254 (default 100)  
     97  
     98# Set up server/client communications 
     99#------------------------------------ 
     100 ServerIPAdr  aaa.bbb.ccc.dd   # Listen for connections on this IPaddress. 
     101                               #  0.0.0.0 will use any address on machine. 
     102 ServerPort            16005   # Well-known port number to export msgs on 
     103 
     104 SendAliveText      ExpAlive   # string sent to client as heartbeat 
     105 SendAliveInt             30   # seconds between alive msgs sent to client. 
     106                               #  0 => no heartbeat 
     107 RcvAliveText       ImpAlive   # text of client's heartbeat (we get this) 
     108 RcvAliveInt              60   # seconds between client's heartbeats to us. 
     109                               #  0 => no heartbeat 
     110 
     111# Optional Socket commands: 
     112# SocketTimeout defaults to RcvAliveInt + 3  
     113#  If set to -1, all socket calls will block (no timeout). 
     114#  SocketTimeout has no effect in export, unless it is set to -1, 
     115#  because there is no code in export to handle socket timeouts. 
     116#  If set to -1, the program may run slightly more efficiently because 
     117#  timeout checking code will not execute. 
     118#---------------------------------------------------------------------- 
     119#SocketTimeout 200000  # Timeout length in milliseconds for socket calls 
     120 
     121 SocketDebug   0       # if 1, socket_ew debug statements are logged 
     122                       # if 0, socket_ew debug is turned off (default) 
     123}}} 
     124 
     125== Helpful Hints ==