Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Programming/Scripts

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 25th September 2010, 18:43
newbie14 newbie14 is offline
Member
 
Join Date: Jul 2010
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default Listener cant get any external connection.

Dear All,
I have a centos 5.5 machine. I have forwarded both port 22 and 9000 on my router. So then I can connect on 22 and remotely login into the machine. The problem when I start my java listener program which is listening on 9000 it cant not establish any connection. I have even add this into the iptables too -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 9000 -j ACCEPT. I have disabled the SELINUX too. What else must I do to make it work any suggestion please? Thank you.
Reply With Quote
Sponsored Links
  #2  
Old 26th September 2010, 19:00
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,739 Times in 2,574 Posts
Default

Maybe it is a problem with your Java program. Do you see it in the output of
Code:
netstat -tap
?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 27th September 2010, 03:34
newbie14 newbie14 is offline
Member
 
Join Date: Jul 2010
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

Dear Falko,
When I type netstat -tap is not there. But the funny part is that when I type "telnet 192.168.2.15 8080" locally in the same machine but different terminal I can see this statement "Remote Connection Accepted" is printed on the server terminal. Below is my codes which is just few lines. What can be my error ya? Thank you.

public static void main(String[] args) {



try {

InetAddress Address = InetAddress.getByName("192.168.2.15");
System.out.println(Address);
final ServerSocket serverSocketConn = new ServerSocket(8080,-1,Address);



while (true)

{

try

{

Socket socketConn1 = serverSocketConn.accept();
System.out.println("Remote Connection Accepted");

//new Thread(new ConnectionHandler(socketConn1)).start();

}

catch(Exception e)

{

System.out.println(e.toString());

}

}



}

catch (Exception e)

{

System.out.println(e.toString());

//System.exit(0);

}

}


QUOTE=falko;240245]Maybe it is a problem with your Java program. Do you see it in the output of
Code:
netstat -tap
?[/QUOTE]
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ispconfig 3 cant receive emails lishaw1968 Installation/Configuration 25 19th August 2013 10:37
ISPConfig 3 Send/Receive mail not working. Acidut General 6 4th April 2010 11:24
squirrelmail and postfix witoszek General 12 1st December 2009 18:07
Attacks on MTA dclardy Installation/Configuration 4 29th September 2009 16:50
Mail not working epicuniversal General 5 13th June 2009 08:24


All times are GMT +2. The time now is 04:34.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.