Hi cd228
it depends on what kind of protocol you want to use.
HTTP is quite straightforward as long as you can use 'get-requests' to transfer variables. All you have to do is create a string, containing your request, maybe do some URL-escaping, send it via groovy's 'toURL()' method and evaluate the output. This can be done line by line or on the whole output at once.
A short example can be found here:
http://mrhaki.blogspot.de/2009/10/groovy-goodness-reading-url-content.htmlA more complex description can be found here. This also shows how to do http-post-requests. Don't fear it's still very easy and mainly hands-on.
https://www.javacodegeeks.com/2013/02/groovy-and-http.htmlOther tcp-services are just a little more work to do, using groovy's socket-objects. I don't have first hand experience, but I did a short test to netcat on a different machine when reading your question and it worked.
The test was a variation of the example here:
https://gist.github.com/mgdelacroix/2036ab7c653fa9d7c045In a more complex setting it may be easier, to write a shellscript, batch-program or whatever and call it from your main-program. An example how to do this can be found in 'Strip or die!' by
ptdw. He gives users the option to name an external program controling an e-stim device. This external program is called via useFile(). That way you could even use a serial connection, if you let the user put in a matching program to translate.
Regards
cgut2001