|
|
StreamsSteams are how the RPC is encoded over the wire. JRemoting has three implementations - ByteStream, ObjectStream and XmlStream. ByteStream is the default and slightly faster on the wire than
ObjectStream. Both are binary encodings. XmlStream
leverages XStream for
an encoding that is text based. Server side usage
server = new SocketServer(new ConsoleServerMonitor(),
new ByteStream(),
new InetSocketAddress(10333));
Client side usage
serviceResolver = new ServiceResolver(new SocketTransport(new ConsoleClientMonitor(),
new ByteStream(),
new InetSocketAddress("localhost", 10333)))
Encodings mush be matched, of course, on both sides to work at all. JRemoting will fail, not necessarily quickly or clearly when you've mismatched encodings. |