Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
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
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) {




Don't get me started about those stupid light bulbs.
subject: can't find an errors but always in connectException
Similar Threads
How to store and retrieve images to MS access and MYsql database
a big problem
problem with urldecoder in doGet mehtod
help required about URLConnection
Problem with session