[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: sockets and connect() question
- From: Dave Ihnat <ignatz dminet com>
- To: redhat-list redhat com
- Subject: Re: sockets and connect() question
- Date: Wed Aug 21 21:24:19 2002
On Wed, Aug 21, 2002 at 10:29:40AM -0500, Jayson Hill wrote:
> I don't know if this is the correct forum for this question, so if not
> perhaps someone could point me to the right spot. Anyway, I am trying to
> run a connection-oriented client program on RedHat 7.2. The client IP is
> 192.168.254.87 and I can ping it from the server, and can ping the
> server from the terminal, as well as connect to it through telnet.
> However, when I try and connect() to the terminal, I get a connection
> refused with errno set to ECONNREFUSED. Upon reading the man page for
> connect() I see that ECONNREFUSED means "no one is listening on the
> remote address". If I can ping, why can I not connect() ?
Two data elements identify a connection--the IP address, and the port.
Further, there are two parts to any connection--the server, and the client.
The server is a program that is listening on a given port. If there's
no program listening, a client connect will fail as you've seen.
Ping works because it's a feature of ICMP; totally different than what
you're trying.
Did you write and run a program on the target system that is listening
on the port you try to connect to? Or, is it a port owned by a known
service? If so, is that service enabled?
If the answer to all the above is "no", you should be upset if it DID
connect...
Cheers,
--
Dave Ihnat
ignatz dminet com
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]