TCP Server Module

Top  Previous  Next

This interface allows PageGate to function as a TCP server to receive TCP packets from a variety of sources. Messages received by this API are output to a directory as a text file that is then read in by the GetASCII API.

 

Step 1: Create a directory for the TCP Server

 

1) In Windows, create a new directory for the TCP Server. This can be any folder accessible to PageGate, whether on the local hard drive or by UNC path to a network resource. However, if PageGate will need to reference a network resource, the services relevant to these processes will need permission to access it. For more information, see the services section of the documentation. We recommend creating a directory called TCP as a sub-directory of PageGate's database directory (By default, c:\PageGateData\TCP\).

 

2) In Windows, browse in to the PageGate program directory.

 

3) Move the pgtcpserver.exe and pgtcp.ini files to the folder you created in step 1.

 

Step 2: Configure the TCP Server's settings

 

1) The first thing we'll need to do is modify the pgtcp.ini file. Open the file in notepad.

 

To give you a little more information, this INI file controls the behavior of the TCP Server. If you are running the evaluation version, it will stop itself every 3-5 days, and/or after 500 messages, whichever comes first.

 

2) Configure the port the TCP server should listen to. By default, the port is set to 5002.

 

3) Change the OutputFolder= value to the directory you created in step 1. By default, C:\PageGateData\TCP\

 

4) Change the LogFolder= value to your logging directory. If you are unsure of what this folder is, open the PageGate Admin and go to the Program - Settings section. By default, C:\PageGateData\Logs\

 

5) Next, we'll need to set the end of record delimiter but let's go in to what that means first. When the TCP Server is receiving information, it doesn't really know what in the data is important; it's just receiving TCP packets of data. The end of record delimiter tells the TCP server that the expressed series of characters denotes a break in the data stream.

 

For example, the TCP server could receive a series of 5 packets:

a) This is

b) a

c) test message #

d) This is a new

e) message

 

If you set EndOfRecordDelimiter = #, that tells the TCP server that everything before every # received is a data block to be parsed.

 

Put another way, the end of record delimiter tells the TCP server how to break down the information it's receiving in to processable chunks.

 

It's the "over" of a CB radio conversation.

 

5) Below that, there are RequiredText and RequiredTextOperator values that can be set.

 

RequiredText specifies text that must appear for a data block to be processed and you may specify multiple values by separating each with a | (pipe).

 

The RequiredTextOperator specifies whether you're using OR or AND logic.

 

For example, let's say you specify the following:

RequiredText=alarm|notification

RequiredTextOperator=AND

 

That tells the TCP server that both the words alarm AND notification need to appear in a received data block for that data block to be treated as a message to send.

 

As another example:

RequiredText=alarm|alert

RequiredTextOperator=OR

 

That tells the TCP server that either the words alarm or alert need to appear in a received data block for that data block to be treated as a message to send.

 

6) Next we have EndOfRecordTimeout, whose value is expressed in milliseconds.

 

If data is received by the TCP server, but the EndOfRecordDelimiter isn't received within the time specified, the data will be accepted for processing anyway.

 

By default, this is set to 3000 milliseconds or 3 seconds.

 

7) RejectOnTimeout determines whether timeouts should post a rejection notice or not. By default, this is set to true.

 

8) AcceptResponse determines what the TCP server will echo to the sending system upon acceptance of a data block.

 

9) RejectResponse determines what the TCP server will echo to the sending system upon rejection of a data block.

 

10) Last, we have two optional settings: StaticRecipient and StaticSender

 

StaticRecipient allows you to specify the name of a specific recipient or group in PageGate that ALL traffic from the TCP server should be passed through.

 

StaticSender allows you to hard code a sender's name that should be associated with ALL traffic from the TCP server.

 

11) Save the .ini file and close notepad.

 

Step 3: Run the TCP Server

 

1) Open a command prompt with elevated permission.

 

2) Change directory to the TCP Server's program directory. By default, c:\PageGateData\TCP\

 

3) Type the following and hit enter:

pgtcpserver /install

 

4) Exit the command prompt.

 

5) Open the Services list in Windows.

 

6) Go in to the Properties of the PageGate TCP Server service.

 

7) Change the Startup Type to Automatic and Start the Service.

 

Step 4: Configure the GetASCII API to process the TCP Server's messages

 

1) Go to Interfaces - GetASCII - Settings.

 

2) Set the 'Polling Directory' to the output folder. By default, C:\PageGateData\TCP\

 

3) Check Enabled.

 

4) Click Apply.

 

5) Go to Program - Settings.

 

6) In the 'Run on this server' section, check GetASCII

 

7) Click Apply.

 

8) If prompted for credentials, leave them blank and click Apply again.

 

Note: If you are already using the GetASCII module, you can use the Advanced Polling Files section to specify the TCP Server's output folder as a secondary polling location. The File(s) value will need to be set to *.asc and it is a Standard file type.