Click here to Skip to main content
15,913,722 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Friends,

I have created a client-server application, using CAsyncSocket class.
I am getting error code 0000274d on client connection.
Can anyone help me in that. Currently only single client is connecting to the server.

Thanks in advance.
Posted

Look at MSDN[^] for return codes:

C#
//
// MessageId: WSAECONNREFUSED
//
// MessageText:
//
// No connection could be made because the target machine actively refused it.
//
#define WSAECONNREFUSED                  10061L


MSDN: "This function is typically used by servers (or any application that wants to accept connections) that could have more than one connection request at a time: if a connection request arrives with the queue full, the client will receive an error with an indication of WSAECONNREFUSED."
 
Share this answer
 
v2
Comments
aamswe 19-Jan-11 23:03pm    
Only one client is conencting to the server. How do I find the reason for above error?
Andrew Brock 19-Jan-11 23:22pm    
I would suggest placing a breakpoint on your call to CAsyncSocket::Listen and stepping through it 1 line at a time (F11) and see if you cant see anything that jumps out as bad... like a buffer size of 0.
You may also need to run something like Wireshark (http://www.wireshark.org/) and see what is going on at a link level (may be 100's of requests comming in), and if you are running Windows Vista/7 open the resource monitor ResMon.exe and check the state of any sessions or listening ports associated with your program
aamswe 20-Jan-11 1:49am    
problem was in socket creation on client side. now client is connecting to the server. But server is not receving messages from client. I have voerriden OnAccept and OnReceive functions, When I am sending message from client, OnAccept event is captured but it's not going in OnRecive. Even I tried to receive message on OnAccept event but zero byte recived.
What could be the problem?
aamswe says:
problem was in socket creation on client side. now client is connecting to the server. But server is not receving messages from client. I have voerriden OnAccept and OnReceive functions, When I am sending message from client, OnAccept event is captured but it's not going in OnRecive. Even I tried to receive message on OnAccept event but zero byte recived.
What could be the problem?

If you are running Windows Vista/7 open ResMon.exe and go to the network page. Check to see if there is any sessions or data send/receive associated with your program.

If you are using a version of Windows previous to Vista, or you feel like it, get Wireshark[^] and start sniffing to see what is sent to/from the server.
 
Share this answer
 

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