Difference between revisions of "Driving the SiGML Player App"

From Virtual Humans
Jump to navigation Jump to search
(More on nc command)
Line 26: Line 26:
 
On Unix systems, including OS X and Linux, or using Cygwin on Windows, the command:
 
On Unix systems, including OS X and Linux, or using Cygwin on Windows, the command:
 
     nc localhost 8052 < mySigns.sigml
 
     nc localhost 8052 < mySigns.sigml
will send SiGML data to the application. The parameter -N may be needed to close the socket on EOF.
+
will send SiGML data to the application. The parameter -N may be needed to close the socket on EOF. Alternatively, the form
 +
    nc localhost 8052 -w 0 < mySigns.sigml
 +
should work on all platforms
  
 
== Example Java Application ==
 
== Example Java Application ==

Revision as of 11:29, 20 June 2023

Home >> CWASA


This page describes the protocol a client app needs to follow in order to drive the SiGML Player app and provides a simple Java application that uses the protocol. The same protpcol is used for the JASigning SiGML Service Player app.

Protocol

The SiGML Player accepts connection requests on standard TCP/IP port number 8052.

Each time the client wants to dispatch a SiGML text to the player it performs the following sequence:

  • Make a new connection to that port (8052) on the server, i.e. the host system running the SiGML Player app, which may or may not be the "localhost".
  • Send the SiGML text on the resulting output stream.
    • If the SiGML text explicitly specifies an encoding in an initial XML declaration then the text should be sent as a byte stream with that encoding.
    • If there's no explicit encoding it should be sent as a UTF-8 stream.
  • Close the stream and the connection.

The protocol is extremely simple: so there's no feedback from the server to tell the client when the performance of a SiGML text is complete -- or indeed whether there are any errors in the SiGML text.

If a new text is dispatched before performance of the previous one is complete, then that previous performance is immediately abandoned in favour of the new one. So, although in principle the client could be on the opposite side of the world from the server, in practice it does not make much sense if the client, i.e. its user, does not actually have line-of-sight contact with the server.

Unix Commandline Scripting

On Unix systems, including OS X and Linux, or using Cygwin on Windows, the command:

   nc localhost 8052 < mySigns.sigml

will send SiGML data to the application. The parameter -N may be needed to close the socket on EOF. Alternatively, the form

   nc localhost 8052 -w 0 < mySigns.sigml

should work on all platforms

Example Java Application

A NetBeans project for a simple Java application is available as a ZIP archive for the SignStreamer Project.

  • The src folder contains Java source files
  • The dist folder contains SignStreamer.jar for the application
  • The application can be run by the command java -jar "SignStreamer.jar"
  • A SiGML file to be sent is selected by clicking the Select File button and sent using the Send File button

The code can be adapted or incorporated in your own code but please acknowledge the source.


Home >> CWASA