unsigned long problems

Milos Negovanovic milos.negovanovic at googlemail.com
Sat Apr 24 16:25:52 EDT 2010


Hi all,

I am using netty to build EPP(extensible provisioning protocol) server!

My pipeline looks like this:

pipeline.addLast("ssl", new SslHandler(engine));
pipeline.addLast("framer", new LengthFieldBasedFrameDecoder(1024*1024, 0, 4, -4, 4));
pipeline.addLast("decoder", new StringDecoder());
pipeline.addLast("encoder", new StringEncoder());
pipeline.addLast("prepender", new LengthFieldPrepender(4, true));
//then businesslogic
pipeline.addLast("handler", new EppServerHandler());

Problem I am having is with LengthFieldBasedFrameDecoder and
LengthFieldPrepender ... length field in EPP is 4 byte unsigned long in
network byte order and not an int.

My client tool cant "speak" with the server (yet). Client is written in python
and frame related routines look like this:

def _getFrame(self):
	header = self.ssl_sock.read(4)
	print struct.unpack('!L', header)[0]
	return self.ssl_sock.read(struct.unpack('!L', header)[0] - 4)

def _sendFrame(self, xml):
	data = struct.pack('!L', len(xml) + 4) + xml
	self.ssl_sock.write(data)

What would be the best way to get around this?

Regards
-- 
Milos Negovanovic
milos.negovanovic at googlemail.com


More information about the netty-users mailing list