tedeh / jayson

Jayson is a simple but featureful JSON-RPC 2.0/1.0 client and server for node.js

Home Page:https://jayson.tedeh.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for Netstring format

TitaneBoy opened this issue · comments

Hi everyone.
I was wondering if there is a way to support in your great module a support for Netstring format for both Server and Client side with TCP interface.

My issue is that I'm trying to communicate to a client/server tcp lib written in C++ (anyrpc) by using your server/client (with tcp interface). But it looks there is no standard way to communicate in TCP way. And unfortunetly, the lib written in C++ use a Netstring format to communicate with others. anyrpc server waits for a request in Netstring format and anyrpc client sends request in Netstring format. So When I'm trying to use your lib to communicate with anyrpc tcp clients/servers , it fails.

Is there a clean way to add an option in your client/server to encapsulate the data (received and sent by the server/client) in Netstring format ?

Thank you very much for your answer.

Thanks, but support for Netstring is something you should be able to implement by subclassing TcpServer and TcpClient quite easily. It is not going into core, but if you are able I suggest you release it as a plugin named something like "jayson-netstring" or some such. If you do this I can link to it from the README.