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 ?

Networking is a very complicated issue. We could take some wild stabs in the dark, but that could take forever.

We need more information from you if we're to help you. Specifically:

1) Please post a small, working example that causes the error on your machine. We might not get the error you get, but seeing the code is valuable.

2) Please post the output of the program.

3) Please post specific details of other commands you run that demonstrate network connectivity.

4) Please post the networking information of your machine (the output of `ifconfig' should do just fine).

John G

Client machine is Solaris Sparc and it is trying to connect to solaris X86

Is the solaris/x86 running an echo server on TCP port 7? What happens when you try and run the following?:

telnet server-ip 7

Yes in x86 machine I am getting the below error
telnet: Unable to connect to remote host: Connection refused

what should I correct

Find out how to run an echo server on Solaris. If your configuration is anything like Linux and runs xinetd, there may be a file /etc/xinetd.d/echo which has config settings for the echo server - the parameter "disable" is set to "yes" by default, set it to "no" and then restart xinetd (again, not sure how that works on Solaris...).

If you do run xinetd and have an /etc/xinetd.d/ folder but no /etc/xinetd.d/echo file, copy this into said file:

service echo
{
    disable     = no
    type        = INTERNAL
    id      = echo-stream
    socket_type = stream
    protocol    = tcp
    user        = root
    wait        = no
}

...and if any of that doesn't work, it's time for a Google search.

deleting