Sven Junge wrote:
> Hello,
>
> I'm behind a Firewall and trying to connect with the following code to an
> inet-address:
>
> URL url = new URL(urlStr);
> InputStream uin = url.openStream();
> BufferedReader in = new BufferedReader( new InputStreamReader(uin));
> boolean more = true;
> while (more)
> {
> String line = in.readLine();
> if (line==null)
> more = false;
> else
> System.out.println( line );
> }
>
> My problem is that I can read out every HTML-code I get from websites within
> the LAN, but by trying to connect to public sites in the net I only get this
> exception:
> "java.net.SocketException: Unexpected end of file from server"
>
> Thanks for your help!
>
> Sven Junge
>
>
If you experience problems with accessing sites on the internet while
everything is fine within the LAN, I would suggest you to have a look at
the firewall settings.
btw, you'd better use InputStream rather than Reader
--
Song
/* E-mail.c */
#define User "Yu.Song"
#define Warwick "warwick.ac.uk"
int main() {
printf("Yu Song's E-mail: %s@%s", User, Warwick);
return 0;}
Further Info. :
http://www.dcs.warwick.ac.uk/~esubbn/
__________________________________________________ _____