Perturbatio #1 take a look at TSocketStream (BRL.Socketstream) It may do what you need. (not in the docs because it is uncommented).