Sponsored Content
Full Discussion: Connection refused
Special Forums IP Networking Connection refused Post 302202394 by gaurav.agrawal on Wednesday 4th of June 2008 06:04:18 PM
Old 06-04-2008
Hello,

The socket() call should be made on the localhost, which means that you wnat to create a socket on the localmachine

In the connect() call, mention the address of the server which you want to connect.

and on the server side, after socket and bind, listen and accept functions should be called for listening and accepting socket from the client.

Regards
Gaurav
 

10 More Discussions You Might Find Interesting

1. SCO

telnet connection refused

I installed Openserver 5.0.7 and I cannot telnet to the localhost and I can't telnet from my old SCO 3.2.42 to the new SCO machine but I can ping the new machine and it will telnet to the old machine. (2 Replies)
Discussion started by: printrick
2 Replies

2. Solaris

Xlib: connection refused by server

Hi guys i am facing this issue while opening new xterm window.please help me out. Xlib: connection to "delop125ld:0.0" refused by server Xlib: Maximum number of clients reached xterm Xt error: Can't open display: delop125ld:0.0 thanks (1 Reply)
Discussion started by: daya.pandit
1 Replies

3. Programming

echo: Connection refused

OS : Solaris sparc In c program After socket created when I do Connect() it results "Connection refused", but the system is online and I am able to do telnet, ping everything, but it says connection refused. What would need to correct ? (6 Replies)
Discussion started by: satish@123
6 Replies

4. Solaris

Solaris 10 ftp connection problem (connection refused, connection timed out)

Hi everyone, I am hoping anyone of you could help me in this weird problem we have in 1 of our Solaris 10 servers. Lately, we have been having some ftp problems in this server. Though it can ping any server within the network, it seems that it can only ftp to a select few. For most servers, the... (4 Replies)
Discussion started by: labdakos
4 Replies

5. UNIX and Linux Applications

PSQLException: Connection refused

I dont' what happened with my servers (test servers only) but I just noticed that suddenly I cannot up the domain anymore (Sun Java System Application Server 9.1_01). a. server.log org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the... (1 Reply)
Discussion started by: lhareigh890
1 Replies

6. Shell Programming and Scripting

ssh/sftp connection refused

Hi all, I logged on to a Unix server and am trying to connect a remote Windows server (Windows NT) via SSH/SFTP. However I always got the following error, sftp username@host_server (or ssh username@host_server) ssh: connect to host host_server port 22: Connection refused Any advise... (1 Reply)
Discussion started by: isaacniu
1 Replies

7. UNIX for Advanced & Expert Users

ftp connection refused

Hi- While trying ftp from AIX to Windows im getting below error. Can anyone share ur views on this topic. root@AB101# ftp -n 10.192.168.68 ftp: connect: A remote host refused an attempted connect operation. ftp> Thanks. (3 Replies)
Discussion started by: yanis
3 Replies

8. Linux

Telnet Connection refused error

Hi all, i got stuck with telnet issue, I am not able to telnet on 4001 port it show connection refused. with default port it will open # telnet 127.0.0.1 Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. Fedora release 14 (Laughlin) Kernel 2.6.35.6-45.fc14.i686 on... (1 Reply)
Discussion started by: muzaffar.k
1 Replies

9. Debian

ftp connection refused

I have two computers running Debian 6.0 and one running Solaris 2.6 on a private network. The Debian computers can ftp to the Solaris computer but if a Debian computer is the destination the ftp connection is refused. I assume this is some security feature of Debian. What can I do to allow... (2 Replies)
Discussion started by: snorkack59
2 Replies

10. Shell Programming and Scripting

FTP connection refused

Hi I am trying to execute a shell script which is in unix server gs1. The script is below which basically connects to another unix server q15 and tries to get a file using FTP . But i get error as "ftp: connect: Connection refused Not connected. Not connected." Please help with if the below... (8 Replies)
Discussion started by: samrat dutta
8 Replies
LWRES_GETADDRINFO(3)						       BIND9						      LWRES_GETADDRINFO(3)

NAME
lwres_getaddrinfo, lwres_freeaddrinfo - socket address structure to host and service name SYNOPSIS
#include <lwres/netdb.h> int lwres_getaddrinfo(const char *hostname, const char *servname, const struct addrinfo *hints, struct addrinfo **res); void lwres_freeaddrinfo(struct addrinfo *ai); If the operating system does not provide a struct addrinfo, the following structure is used: struct addrinfo { int ai_flags; /* AI_PASSIVE, AI_CANONNAME */ int ai_family; /* PF_xxx */ int ai_socktype; /* SOCK_xxx */ int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */ size_t ai_addrlen; /* length of ai_addr */ char *ai_canonname; /* canonical name for hostname */ struct sockaddr *ai_addr; /* binary address */ struct addrinfo *ai_next; /* next structure in linked list */ }; DESCRIPTION
lwres_getaddrinfo() is used to get a list of IP addresses and port numbers for host hostname and service servname. The function is the lightweight resolver's implementation of getaddrinfo() as defined in RFC2133. hostname and servname are pointers to null-terminated strings or NULL. hostname is either a host name or a numeric host address string: a dotted decimal IPv4 address or an IPv6 address. servname is either a decimal port number or a service name as listed in /etc/services. hints is an optional pointer to a struct addrinfo. This structure can be used to provide hints concerning the type of socket that the caller supports or wishes to use. The caller can supply the following structure elements in *hints: ai_family The protocol family that should be used. When ai_family is set to PF_UNSPEC, it means the caller will accept any protocol family supported by the operating system. ai_socktype denotes the type of socket -- SOCK_STREAM, SOCK_DGRAM or SOCK_RAW -- that is wanted. When ai_socktype is zero the caller will accept any socket type. ai_protocol indicates which transport protocol is wanted: IPPROTO_UDP or IPPROTO_TCP. If ai_protocol is zero the caller will accept any protocol. ai_flags Flag bits. If the AI_CANONNAME bit is set, a successful call to lwres_getaddrinfo() will return a null-terminated string containing the canonical name of the specified hostname in ai_canonname of the first addrinfo structure returned. Setting the AI_PASSIVE bit indicates that the returned socket address structure is intended for used in a call to bind(2). In this case, if the hostname argument is a NULL pointer, then the IP address portion of the socket address structure will be set to INADDR_ANY for an IPv4 address or IN6ADDR_ANY_INIT for an IPv6 address. When ai_flags does not set the AI_PASSIVE bit, the returned socket address structure will be ready for use in a call to connect(2) for a connection-oriented protocol or connect(2), sendto(2), or sendmsg(2) if a connectionless protocol was chosen. The IP address portion of the socket address structure will be set to the loopback address if hostname is a NULL pointer and AI_PASSIVE is not set in ai_flags. If ai_flags is set to AI_NUMERICHOST it indicates that hostname should be treated as a numeric string defining an IPv4 or IPv6 address and no name resolution should be attempted. All other elements of the struct addrinfo passed via hints must be zero. A hints of NULL is treated as if the caller provided a struct addrinfo initialized to zero with ai_familyset to PF_UNSPEC. After a successful call to lwres_getaddrinfo(), *res is a pointer to a linked list of one or more addrinfo structures. Each struct addrinfo in this list cn be processed by following the ai_next pointer, until a NULL pointer is encountered. The three members ai_family, ai_socktype, and ai_protocol in each returned addrinfo structure contain the corresponding arguments for a call to socket(2). For each addrinfo structure in the list, the ai_addr member points to a filled-in socket address structure of length ai_addrlen. All of the information returned by lwres_getaddrinfo() is dynamically allocated: the addrinfo structures, and the socket address structures and canonical host name strings pointed to by the addrinfostructures. Memory allocated for the dynamically allocated structures created by a successful call to lwres_getaddrinfo() is released by lwres_freeaddrinfo(). ai is a pointer to a struct addrinfo created by a call to lwres_getaddrinfo(). RETURN VALUES
lwres_getaddrinfo() returns zero on success or one of the error codes listed in gai_strerror(3) if an error occurs. If both hostname and servname are NULL lwres_getaddrinfo() returns EAI_NONAME. SEE ALSO
lwres(3), lwres_getaddrinfo(3), lwres_freeaddrinfo(3), lwres_gai_strerror(3), RFC2133(), getservbyname(3), bind(2), connect(2), sendto(2), sendmsg(2), socket(2). COPYRIGHT
Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") Copyright (C) 2000, 2001, 2003 Internet Software Consortium. BIND9 Jun 30, 2000 LWRES_GETADDRINFO(3)
All times are GMT -4. The time now is 05:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy