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.
prushik
50
Junior Poster
Recommended Answers
Jump to PostTry seeing which error code WSAGetLastError() returns, error codes are listed in
http://msdn2.microsoft.com/en-us/library/ms740668(VS.85).aspx
All 2 Replies
Reply to this topic
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.