Listening on localhost - cannot connect to host using port 3010


 
Thread Tools Search this Thread
Special Forums UNIX Desktop Questions & Answers Listening on localhost - cannot connect to host using port 3010
# 1  
Old 12-01-2011
Listening on localhost - cannot connect to host using port 3010

Hi Guys,

my issue is - I have people connecting to my hosts from the outside world (for POC testing). There application listens on a port 3010 which is bound to the localhost. Using netstat -an | grep LISTEN it is the only port that is bound - ie: ftp, ssh etc listen on all interfaces. I need to be able to connect via other hosts, is there anyway i can get that port to listen on all interfaces?

Thanks
# 2  
Old 12-01-2011
You have to make sure you are binding the socket to "any". For instance, in C:
Code:
server_address.sin_family = AF_INET;
server_address.sin_addr.s_addr = htonl(INADDR_ANY);
bind(sock, (struct sockaddr *) &server_address, sizeof(server_address))

or in PERL:
Code:
my $proto = getprotobyname('tcp');

socket(Server, PF_INET, SOCK_STREAM, $proto)               || die "socket: $!";
setsockopt(Server, SOL_SOCKET, SO_REUSEADDR, pack("l", 1)) || die "setsockopt: $!";
bind(Server, sockaddr_in($lport, INADDR_ANY))              || die "bind: $!";
listen(Server,SOMAXCONN)                                   || die "listen: $!";

JAVA is left as an exersize for the student :-).
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Rpcbind Listening on a Non-Standard Port

Hello, I was trying to find information about below rpcbind issue and how can I fix it so that, it wont happen again. Below is the one of the vulnerability from my security team, RPC service name: portmapper service protocal: udp Portmapper found at: 327xx service port: 327xx ... (2 Replies)
Discussion started by: system.engineer
2 Replies

2. Shell Programming and Scripting

Connect to target host from Source host.

Hi All, Need to connect to target host and execute a command and connect back to source host to continue with next set of command execution. Is there a utility/command using which we can connect to target host ? Please suggest. Note: Netezza database is instaled on Linux server. ... (4 Replies)
Discussion started by: Nagaraja Akkiva
4 Replies

3. IP Networking

Unable to connect to localhost in Debian 6?

Hello Everyone, I have unable to run the default server with localhost in my Debian machine. While trying to run Django I get: Error: That IP address can't be assigned-to. error While trying to run galaxy-dist I get this error: socket.error: Cannot assign requested address I can't telnet... (3 Replies)
Discussion started by: sachit adhikari
3 Replies

4. Red Hat

Can't connect to database listening on port 6730, Please Guide.

Hi all, I am not able to telnet from one system to another. say from system1 to system2 However i am able to do telnet system2 1521 but I am not able to do telnet system2 6730 & telnet system2 6731 & telnet system2 6732 some other onformation: system1:root(/root)# rpm -qa |... (1 Reply)
Discussion started by: manalisharmabe
1 Replies

5. IP Networking

How to find if remote n/w port is listening on HP-UX from the binary

Hi, I have an executable running on HP-UX, from this executable I need to findout if the portnumber. lets say 7890,7891, 7892 are listening on the remote server running on HP-UX. I can do it by creating socket, connect etc. But is there any other way of doing it using "system()" function or... (3 Replies)
Discussion started by: einsteinBrain
3 Replies

6. Cybersecurity

Listening to port when no IP address is assigned

Hi Pals Consider a case where the network interface is there and it is connected to a network. Only thing left here is I need to set a static ip/ip though dhcp (though ifconfig) I heard that it is possible to listen even if the ip address is not set. So is there any possibility of an attack over... (1 Reply)
Discussion started by: sreejithc
1 Replies

7. Solaris

PING - Unknown host 127.0.0.1, Unknown host localhost - Solaris 10

Hello, I have a problem - I created a chrooted jail for one user. When I'm logged in as root, everything work fine, but when I'm logged in as a chrooted user - I have many problems: 1. When I execute the command ping, I get weird results: bash-3.00$ usr/sbin/ping localhost ... (4 Replies)
Discussion started by: Przemek
4 Replies

8. Linux

ssh: connect to host traviata port 22: No buffer space available

What does that mean? traviata being my distant host? What am i to do? (0 Replies)
Discussion started by: penguin-friend
0 Replies

9. Shell Programming and Scripting

Listening on port for incoming data?

I am not what I would call an experienced programmer. I know some ksh etc.. I need to be able to listening on a port for incoming data on a ultra 10 using solaris 9. Basically all that I need to do at the moment is to log the incoming data on a specific port number. Any ideas on how I... (6 Replies)
Discussion started by: frustrated1
6 Replies

10. IP Networking

port not listening..

Hi.. I am using HPux11.0 i want to know if server not listening to a tcp port what should we do to resolve the problem.... in /etc/services tcp port 7108/tcp is mentioned for some perticular application.. while starting that application error is coming could not establish listening address... (1 Reply)
Discussion started by: Prafulla
1 Replies
Login or Register to Ask a Question