remote server access
class Server {
public static void main(String[] ar) {
try {
System.out.println("waiting for connection....");
ServerSocket ss = new ServerSocket(2000);
Socket soc = ss.accept();
System.out.println("connected with client");
} catch (Exception e) {System.err.println(e); }
}
}
this is my server program which has a static IP (Remote system connected with Internet).
and this is my client program,
class Client {
public static void main(String[] ar) {
try {
Socket s = new Socket("serverIP", 2000);
System.out.println("successfully connected");
} catch (Exception e) { System.out.println(e); }
}
}
my client program is running in separate LAN which is connected with DSL line.
but i could not connect with the server. (serverIP in client is a remote IP address)
and at the same time if i try the client with dialup i can.
what is the problem pls help me.
the above is my simple program.
only if i solve this, i can move further.
pls guide me.
BY
Thamizaharasu
|