Thanks for your answer.
I'm trying to communicate lab machinery (Mindray BC-5380).
The mindray is a client and I a server.
I wait the connection with commands:
LET ch = base.Channel.create ()
CALL ch.openServerSocket (null, "2575", "ub")
LET rigaw = ch.readLine ()
after the readline () everything stops until the machine corce connection close.
At this point I read everything at once, but the handshaking fail.
I think the problem is caused by the lack of EOF from the machine and therefore the readline does not intercept the incoming data.
The HL7 protocol only provides control characters <VT> HL7 Message <FS> <CR> (HL7 Minimum Layer Protocol (MLP) )