If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Problem with Socket :: java.net.ConnectException

Hi,
I am new to socket programming but have experience in Java.
My desktop is connected to the institute LAN and that is how I connect to the rest of the planet.
Now I was trying to make a file tranfer protocol. The socket part of the code is : For Server:
InetAddress IPServer = InetAddress.getByName("172.26.94.199");
ServerSocket serSoc = new ServerSocket(8000,50, IPServer);
while(true) {
soc = serSoc.accept();
start();
}
For Client
InetAddress serverIP = InetAddress.getByName("172.26.94.199");
soc = new Socket(serverIP, 8000);

When I run the client i get the Exception :java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:364)
at java.net.Socket.connect(Socket.java:507)

The code works well by using 'localhost' (both in server and client) but I want my application to work on a remote computer also. The program gives exceptions when I use the IP address of my machine. And I checked the method InetAddress.getByIP(".....") ; .It does not exist