I just tried to create a small socket application with reference to tutorials on the web..
Hers's the script for the socket application
When I am running this program,I am getting an error "Connection refused:connect " error for all the port numbers in the range except for port number 135 which is the TCP/IP... Sometimes it also prints the error " No buffer space available (maximum connections reached?): JVM_Bind"....
I am somewhat unfamiliar wd thoses error and I googled as well but couldn't extract musch from it...
What do those errors exactly mean and why I am able to create a socket a only 1 port???
Thans in adv
Hers's the script for the socket application
Code:
package sockets_1;
import java.net.*;
import java.io.*;
public class socket_class {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
//test_url();
test_socket();
}
public static void test_socket(){
String host="localhost";
for (int i=130;i<150;i++){
try{
Socket sck=new Socket(host,i);
System.out.println("Server at "+i+" port");
}
catch(IOException e){
System.err.print(e.getMessage());e.printStackTrace();
}
}
}
}
When I am running this program,I am getting an error "Connection refused:connect " error for all the port numbers in the range except for port number 135 which is the TCP/IP... Sometimes it also prints the error " No buffer space available (maximum connections reached?): JVM_Bind"....
I am somewhat unfamiliar wd thoses error and I googled as well but couldn't extract musch from it...
What do those errors exactly mean and why I am able to create a socket a only 1 port???
Thans in adv
Comment