I am using bloodshed dev-c++ ide. Win XP Media Center Edition.
I am trying to learn how to use winsock, I have compiled a very simple (and very sloppy) little winsock application with the help of like 3 or 4 different tutorials
the client sends a hard coded string to the server at my loopback address (127.0.0.1). the server receives the string
that all works, I can get the string and display it on the screen. However, the recv() function always returns -1 (error) instead of the expected number of bytes received. Why does this happen? It doesn't make sense because I do actually receive the string. I am stumped.

Recommended Answers

All 2 Replies

WSAGetLastError() always returns 0. which is nothing.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.