You could use vortex http://www.aspl.es/vortex/doc.html its a BEEP Core protocol mapped into TCP/IP layer
Some of its features are:
Robust and well tested BEEP implementation with a threaded design (non-blocking parallel comunications), written in ANSI C.
Context based API design making the library stateless. Support to run several ejecution contexts in the same process.
A complete XML-RPC over BEEP RFC 3529 with a IDL/XDL protocol compiler (xml-rpc-gen).
A complete TUNNEL (RFC3620) support.
Complete implementation for TLS and SASL profiles.
Modular design which allows to use only those components needed.
Support to proxy BEEP connections through HTTP proxy servers.
Support for single threaded (no async notification) programming.
They even have a Javascript BEEP implementation.
If you don't know what BEEP is.
http://en.wikipedia.org/wiki/BEEP
BEEP (Blocks Extensible Exchange Protocol) is a framework for creating network application protocols. It includes an application protocol kernel for connection-oriented asynchronous interactions, and can be used both for binary and text messages within the context of a single application user identity.[1]
BEEP is intended to abstract-out the common features that have traditionally been duplicated in each protocol implementation. BEEP (formerly called BXXP) typically runs on top of TCP and allows the exchange of messages called 'frames'. Unlike HTTP (and similar protocols), either end of the connection can send a frame at any time, and 'questions' and 'replies' can be interleaved easily. BEEP also includes facilities for encryption and authentication, and is highly extensible.
BEEP was designed by Marshall Rose, who also worked on the POP3, SMTP, and SNMP protocols.[2
It works on Windows, Mac, Linux