Connecting to External TCP Streams
To demonstrate the TCP stream Datasource in action we will try connecting to an publically accesible external TCP stream. To do this we must first install a separate instance of the Connector service and run it in a console.
To do this:
-
Create a new directory in the desired location on your machine (for instance on the C: drive alongside the inmation.root folder, named connector2).
-
Copy the "bin" directory from the original
inmation.root
directory where system:inmation was first installed on the machine. -
Open a command prompt window from the new "bin" directory (or navigate there in the command prompt) and enter a command using the following format:
inmation.exe -e [Component] --instance [InstanceName] --port [Port]
For example: inmation.exe -e Connector --instance Connector2 --port 5100
This will launch a Connector service (instance name Connector2) running in Console mode.

Return to DataStudio and create a second Connector named Connector2 under the Core. In the communication settings give the hostname as localhost and set the port to the same one used when launching the Connector in console mode (for example, 5100). Once cretewd the Connector should be connected and visible in the I/O model.

Create a new Datasource under Connector 2 and change the server type to Generic TCP Stream. Enter the remote hostname
as towel.blinkenlights.nl
and set the Port number to 23.

In the Lua Script Body of the Datasource enter the following script:
return { received = function(data) print('recvd: ', data) end, }
In this script we return a table that only invokes the received callback function. Once the new TCP Datasource is created it should go green in the I/O Model indicating that it has connected to the TCP stream.

Now, return to the Console window and see the data received from the configured TCP source streaming. Enjoy the Movie!
