Sponsored Content
Special Forums UNIX Desktop Questions & Answers Listening on localhost - cannot connect to host using port 3010 Post 302578283 by m.d.ludwig on Thursday 1st of December 2011 08:26:18 AM
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 :-).
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
KUMO-SERVER(1)						      General Commands Manual						    KUMO-SERVER(1)

NAME
kumo-server - kumofs server daemon SYNOPSIS
kumo-server -m <addr[:port=19700]> -p <addr[:port19700]> -l <addr[:port=19800]> -s <path.tch> DESCRIPTION
kumo-server stores actual data. You can add kumo-servers after buiding the cluster. You can get live status of the kumo-manager using kumostat and kumotop command. OPTIONS
-l <addr[:port=19800]> --listen listen address -L <port=19900> --stream-listen listen port for replacing stream -f <dir=/tmp> --offer-tmp path to temporary directory for replacing -s <path.tch> --store path to database -m <addr[:port=19700]> --manager1 address of manager 1 -p <addr[:port=19700]> --manager2 address of manager 2 -S <number=20> --replicate-set-retry replicate set retry limit -D <number=20> --replicate-delete-retry replicate delete retry limit -gN <seconds=60> --garbage-min-time minimum time to maintenance deleted key -gX <seconds=3600> --garbage-max-time maximum time to maintenance deleted key -gS <kilobytes=2048> --garbage-mem-limit maximum memory usage to memory deleted key -k <number=2> --keepalive-interval keepalive interval in seconds -Ys <number=1> --connect-timeout connect timeout time in seconds -Yn <number=4> --connect-retry-limit connect retry limit -Ci <number=8> --clock-interval clock interval in seconds -TW <number=2> --write-threads number of threads for asynchronous writing -TR <number=4> --read-threads number of threads for asynchronous reading -o <path.log> --log output logs to the file -g <path.mpac> --binary-log enable binary log -v --verbose -d <path.pid> --daemon EXAMPLE
[on svr1 ]$ kumo-server -v -l svr1 -m mgr1 -p mgr2 -s /var/kumodb.tch -gN 5 -gS 20480 [on svr2 ]$ kumo-server -v -l svr2 -m mgr1 -p mgr2 -s /var/kumodb.tch -TR 6 -TW 4 [on svr3 ]$ kumo-server -v -l svr3 -m mgr1 -p mgr2 -s /var/kumodb.tch -Ci 16 [localhost]$ kumo-server -v -m localhost -l localhost:19801 -L 19901 -s ./database1.tch [localhost]$ kumo-server -v -m localhost -l localhost:19802 -L 19902 -s ./database2.tch [localhost]$ kumo-server -v -m localhost -l localhost:19803 -L 19902 -s ./database3.tch SEE ALSO
kumostat(1), kumotop(1), kumolog(1), kumomergedb(1), kumohash(1). kumo-server July 2009 KUMO-SERVER(1)
All times are GMT -4. The time now is 03:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy