This is an example how to implement an TCP client for the sweet productivity server. The service uses a base class for TCP communication, look at that project for more information about TCP services. Since groovy lives in the JVM it is recommended to build a jvm service.
For basic information see boilerplate service.
More Information on sweet productivity.