aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes can't find an errors but always in connectException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "can Watch "can New topic
Author

can't find an errors but always in connectException

Abhijith Sugunan
Greenhorn

Joined: Aug 04, 2012
Posts: 10
/*ConnectException : Address is invalid on the local machine or port is not valid on the remote machine .And i am doing it in my wampserver .i get this program correct before but now it's result in exception */

import java.net.*;
import java.io.*;

class nightWork {


public static void main(String [] args) throws Exception{

int res;
URL url = new URL("http://localhost/res.php");"
URLConnection con = url.openConnection();

try {

InputStream in = con.getInputStream();
OutputStream out = con.getOutputStream();

while(((res=in.read()) !=-1)) {

System.out.println((char) res);

}

}catch(IOException e) {

System.out.println(e);

}

}



}
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can't find an errors but always in connectException