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 EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "can Watch "can New topic

can't find an errors but always in connectException

Abhijith Sugunan

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 */


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((( !=-1)) {

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


}catch(IOException e) {




I agree. Here's the link:
subject: can't find an errors but always in connectException
Similar Threads
help required about URLConnection
Problem with session
a big problem
How to store and retrieve images to MS access and MYsql database
problem with urldecoder in doGet mehtod