I would avoid programming at the Socket Level if you can : and as Othos suggested - try to use a built-in-connector. (of which there are many types already)
You *can* do this if you really really need to do (since PRPC is based on Java) - but you would have to take care of all the plumbing, error-checking etc. yourself. (And in particular handling any multi-threading will be quite complicated to handle - and the usual way of handling socket programming in java is to use two threads - one for the InputStream, the other for OutputStream).
You could consider writing your own standalone Java API to do all the hard-stuff: and 'wrapping' that up in a JAR file , which you could import into PRPC; best to find an existing one though usually.