I am trying to make a socket connection using TSocket and (being not at all a specialist) got into troubles
(even after trying hclient.c for example)
The problem is that after opening the connection I should get back an "OK"
e.g.:
telnet tasp 2911
Trying 129.129.138.16…
Connected to tasp.psi.ch.
Escape character is ‘^]’.
OK
I am trying to make a socket connection using TSocket and (being not at all a specialist) got into troubles
(even after trying hclient.c for example)
The problem is that after opening the connection I should get back an "OK"
e.g.:
telnet tasp 2911
Trying 129.129.138.16…
Connected to tasp.psi.ch.
Escape character is ‘^]’.
OK
hangs for ever.
[/quote]
It hangs, because it blocks, until all 256b are read. You may want to use no-blocking sockets.
I am not sure about ROOT’s implementation, but maybe something like setting socket->SetOption(kNoBlock, kTRUE); and using socket->Select may help…