TPSocket TServerSocket

I’m absolutely ignorant about network connections and I’m trying to implement a socket communication application. I have a functioning program using:

TPSocket(“localhost”, 9090, 1);
on CLIENT side and
ss = new TPServerSocket(9090, kTrue);
sock = (TPSocket*) ss->Accept();
on SERVER side

My problem is that when I replace “localhost” on client side by “some_other_host”, the code hangs (long wainting with no error) on the ss->Accept() line.
I don’t know where to start debugging. Am I missing something in my configuration file .rootauthrc or something?
Can it be a problem I’m a different user on the client and server machines?
Please send some begginers light into this…

  Thanks in advance,


Hi Rui,

where is the client and where is the server running? Is there firewall in between? Instead of localhost just try the hostname of your local machine. Thart should work. Describe a bit more your setup. Can you run the $ROOTSYS/tutorias/hserv.C and hclient.C demos?

Cheers, Fons.

PS: if you only need a simple sockets use TSocket and TServerSocket (the TPSocket classes support multiple-streams for efficient wide area access)

Hi ,

If I change “localhost” to “local_machine_hostname” the programs runs the same with no problems.
I have a small network of 9 PCs running linux and one computer server attributing DNS, DHCP, etc. Computers connect through the server which (I think) acts also as firewall.
The hclient.C and hserv.C demos have the same problem, meaning: they run well on the local machine, but if I change localhost to some other hostname (besides the local machine hostname) they wait forever to connet.
If you think it might be because of the server in between the PCs, what do you suggest to solve it?