Idov
Idov

Reputation: 5124

C++ socket's send() causes system error 10053


I'm trying to send a message from my client to my server (currently they are both running in the same process, but I don't think it matters).
The connection is established well (I can see it with "CurrPorts" - much more user friendly than TcpView). But then, when I send the message, I get the error:
"An established connection was aborted by the software in your host machine." (number 10053)
and then the connection breaks...

here is the relevant code:

bool Client::Send(void* msg, int size)
{
    int sockId = m_socket.GetId();
    struct sockaddr_in remote = m_socket.GetRemotePoint().GetBasePoint();
    const char* buf = (const char*)msg;
    int error = send(sockId, buf, size, 0);
    //int g = GetLastError();
    //if (g != 0)
    //{
    //  g = g;
    //}
    return (error != -1);
}

Does anybody know what's going on?
thanks :)

Upvotes: 2

Views: 8323

Answers (2)

Idov
Idov

Reputation: 5124

I'm so stupid... :/
I have this class MySocket which I create during Accept, but in its destructor, I CLOSE the socekt.
thanks everybody :)

Upvotes: 2

Ben
Ben

Reputation: 35613

That's WSAECONNABORTED which means that your local machine has killed the connection. Possibly a firewall issue?

Upvotes: 2

Related Questions