The TCP driver is geared much more toward ASCII text.
You will probably have to open raw sockets yourself. You can do this with the Python standard library, but Jython's implementation has some potential resource leaks. You're probably going to have a better time using Java's standard library.
There's some valuable discussion (and some example scripts) in this thread, as a starting point: