I'm creating a multiplayer game using winsock, but I've been having several problems with winsock. I've been searching for an alternative to it, but I haven't found anything. If anyone could point me to something I could use in place of winsock (a free something), I would greatly appreciate it.
Evan M 1 Light Poster
Recommended Answers
Jump to Post> but I've been having several problems with winsock.
Such as?If it's because your programs are crashing, or have odd behaviour?
Then I'm afraid that's all down to bugs in your code. Changing libraries won't solve anything.
Or is there some aspect of network functionality you …
Jump to Post> The largest problem is that winsock appears to be appending data to the end of the buffer
My guess is that you're assuming recv() appends a \0 (it doesn't), and you're also not paying close enough attention to the return result of recv() either.> When I used …
Jump to PostYeah, that's pretty much wrong. You can't look at the data to determine what happened.
char tempBuffer[100]; int error = recv( sock, tempBuffer, sizeof(tempBuffer)-1, 0 ); if ( error > 0 ) { // error is the number of bytes received. tempBuffer[error] = '\0'; // we allowed …
All 10 Replies
Salem 5,265 Posting Sage
Evan M 1 Light Poster
mahlerfive 23 Junior Poster in Training
Salem 5,265 Posting Sage
Evan M 1 Light Poster
Salem 5,265 Posting Sage
dmanw100 36 Posting Whiz in Training
Salem 5,265 Posting Sage
mahlerfive 23 Junior Poster in Training
dmanw100 36 Posting Whiz in Training
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.