NoRouteToHost Exception

Hi Experts,

I am new to socket programming. I want to develop voice chat client application.

Now i have few queries if it is solved it will help me great to develop my application. I am final year student of MCA please i have to complete this application in very short time Early reply help me great.

1) I am behind the proxy server and i want to connect to server to fetch the tabele's data from database.

2) I want to know the list of connected User which are under my group or my buddy list.

Give me Initial steps to Develop it

[568 byte] By [Sunaya] at [2007-11-26 19:49:03]
# 1
I see no problems there ...See basic documentation on your JDK: guides/net/proxies.html
hiwaa at 2007-7-9 22:37:14 > top of Java-index,Archived Forums,Socket Programming...
# 2

I have completed some code that is i am giving here it gives me NoRouteToHost Exception. I know i am behind the firewall. What to do to solve this problem. please reply as soon as possible

import java.net.*;

import java.io.*;

import java.util.*;

import java.security.Security;

import javax.net.SocketFactory;

public class ConnectToServer

{

ConnectToServer()

{

System.setProperty("httpProxy", "true");

System.setProperty("http.ProxyHost", "192.168.19.81");

System.setProperty("http.ProxyPort", "80");

System.setProperty("http.proxyType", "3");

System.setProperty("http.proxyUser","sunay");

System.setProperty("http.proxyPassword","sunay123");

//System.out.println("Called");

}

public void doIt()

{

Socket socket;

BufferedInputStream in;

PrintWriter out;

try

{

System.out.println("Entered");

socket = new Socket("69.28.247.160",9090);

System.out.println("OK");

}

catch(NoRouteToHostException ex)

{

System.out.println(ex.getMessage());

}

catch(Exception ex)

{

System.out.println(ex.getMessage());

}

}

public static void main(String args[])

{

ConnectToServer obj = new ConnectToServer();

obj.doIt();

}

}

it gives me the error NoRouteToHost Exception

Sunaya at 2007-7-9 22:37:14 > top of Java-index,Archived Forums,Socket Programming...
# 3

Let me give you in brief. i want to develop voice chat client. Now when client sign in first it has to check that he is authenticated or not. For that i want client to connect to server. i have posted the code. but when i am trying to connect to the server it gives me error that NoRoutetoHost Exception. I know this is because of Firewall installed. But how to get rid from this firewall problem

Sunaya at 2007-7-9 22:37:14 > top of Java-index,Archived Forums,Socket Programming...
# 4

>System.setProperty("httpProxy", "true");

This does nothing regardless of what you set it to.

>System.setProperty("http.ProxyHost", "192.168.19.81");

>System.setProperty("http.ProxyPort", "80");

These do nothing when you're using a Socket. They have an effect when you use an http: URL to create an HttpURLConnection.

>System.setProperty("http.proxyType", "3");

This does nothing in the JDK or JRE. It seems to be an urban myth, or possibly a vendor-specific extension.

>System.setProperty("http.proxyUser","sunay");

>System.setProperty("http.proxyPassword","sunay123");

Never heard of these either. See http://java.sun.com/j2se/1.5.0/docs/guide/net/proxies.html for the properties that actually have an effect.

If you use a Socket, the only two ways to get a proxy involved are (i) set socksProxyHost & socksProxyPort to a SOCKS proxy, if you have one, or to use java.net.Proxy in association with the corresponding constructor of java.net.Socket.

If you use a URL, you can set http.proxyHost & http.proxyPort to your HTTP proxy.

ejpa at 2007-7-9 22:37:14 > top of Java-index,Archived Forums,Socket Programming...
# 5

Hi Expert,

Right Now I get the thing what you want to explain me. Now Let me Give you the thing what i want to do. I want to create a voice chat client. same like yahoo, or gtalk. Now when client enter his id and password then i want to check in my database that are remotely stoerd on server. Now what to do for that. Let me tell the problem is how to cross the firewall and check the authentication if i am behind firewall

Sunaya at 2007-7-9 22:37:14 > top of Java-index,Archived Forums,Socket Programming...
# 6

Hi Expert,

Right Now I get the thing what you want to explain me. Now Let me Give you the thing what i want to do. I want to create a voice chat client. same like yahoo, or gtalk. Now when client enter his id and password then i want to check in my database that are remotely stoerd on server. Now what to do for that. Let me tell the problem is how to cross the firewall and check the authentication if i am behind firewall

Sunaya at 2007-7-9 22:37:14 > top of Java-index,Archived Forums,Socket Programming...
# 7
java.net.Proxyjava.net.Authenticator
ejpa at 2007-7-9 22:37:14 > top of Java-index,Archived Forums,Socket Programming...
# 8

would you please give me the guideline for developing my application for voice chat. There is not so much time left. Deadline for my project submission is very near and i have to submit it. Can i develop it thru socket programming.? I know something abt Java Media Framework

Thanks In Advance

Sunaya at 2007-7-9 22:37:14 > top of Java-index,Archived Forums,Socket Programming...