Click here to Skip to main content
15,887,827 members
Please Sign up or sign in to vote.
1.33/5 (2 votes)
Hi
I have a simple chat program in c# with a client and a server
when I start the program it give me warning with this message:

Additional information: Could not connect to net.tcp://localhost:1234/Chat/ChatService. The connection attempt lasted for a time span of 00:00:02.0986369. TCP error code 10061: No connection could be made because the target machine actively refused it 127.0.0.1:1234.

what's wrong?
help me
thanks :)

this is a code:


C#
public void Start(ReceiveClient rc,string name)
        {
            inst = new InstanceContext(rc);
            chatClient = new ChatService.SendChatServiceClient(inst);
            chatClient.Start(name);
        }
Posted

1 solution

Quote:
what's wrong?

The error message tells you What is the problem
Quote:
Could not connect to net.tcp://localhost:1234/Chat/ChatService.

and why
Quote:
No connection could be made because the target machine actively refused it 127.0.0.1:1234.


Do you have a firewall ?
Have you allowed your program to communicate with outside via a tcp/ip port ? Particularly, is it allowed to listen a port ?
What is your OS ?
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900