scriptcs TCP client and server Script Pack: ScriptCs.Net

Last week, I gave a brown bag talk at Southworks about scriptcs and one of the things I explained in depth were script packs. If this is the first time you hear about scriptcs be sure to check:

There is a lot of information out there, and things are moving really fast so there is no sense in writing everything down here as some of it would be deprecated in a couple of months.

Script Pack Concept

Currently, a script pack is a .dll that exposes an object which simplifies interaction with a set of components. To get a better idea of how this works, check out the existing script packs and the tutorials on how to create one. The reason I say "currently" is that at some point in the near future you will be able to create your script packs using .csx script files.

As this is one of the best features of scriptcs (in my opinion), since it allows you to get up and running with your favorites libraries in no time, I decided I had to create a simple script pack that will show how to take advantage of it. It seems I did a good job selling it, as my friend Ezequiel Jadib went ahead and created a script pack of his own that allows you to interact with Azure Media Services from the scriptcs REPL.

ScriptCs.Net Script Pack

Inspired by node.js net module I created a script pack that allows you to easily create TCP server and clients, abstracting you from all the complexity of using sockets. For example, to setup a TCP server you can simply write something like:

I’m only going to include that simple piece of code in this blog post, as the project’s home page is updated whenever the API changes and I also created a sample that shows you how to setup a simple chat.

Future

At the moment I intend to continue adding features as I see fit, but your feedback will definitely be welcome either in the form of PRs or issues.  Most of the features that will be added are going to be used to implement a multi-user interactive REPL that leverages this script pack for communication and ScriptCs.Core to interpret the scripts.