Service Pack 3,4&5 Socket Setup and Problem

Under NT4.0 SP3 the sequence of:
  WSAStartup(MAKEWORD(1,1), &data) / socket() / bind()
  worked fine.

We moved to NT4.0 SP4 and the above sequence failed.  We changed to:
  WSAStartup(MAKEWORD(2,1), &data) / socket() / bind()
  and this worked fine.

We have moved to NT4.0 SP5 and I cannot find any working combination.

Question: What's the difference between SP3, SP4 and SP5
and what do I have to do to get SP5 to work?
Who is Participating?
MaDdUCKConnect With a Mentor Commented:
this is the NT5 area, not the SP5 area. And this question should be in Windows Programming anyway. But whatever, after your WSAStartup call, check the version of the winsock library allocated:

// initialize winsock
if (WSAStartup(MAKEWORD(2,0), &wsadata) != 0)
  throw mdException::mdSocketException("failed to initialize the winsock subsystem.");
// check version
int maj = LOBYTE(wsadata.wVersion);
int min = HIBYTE(wsadata.wVersion);
std::cout << "winsock version " << maj << '.' << min << std::endl;
if (maj != 2 || min != 0)
  throw mdException::mdSocketException mdERR_SOCKWRONGVER, "failed to initialize requested version of the winsock subsystem.");

this will tell you the highest version that the program can find.
Try MAKEWORD(2,0).  If that doesnt work try reading the version member of the stat structure.  I dont know what version of Winsock is built into NT 5.0, but the version member should tell you the proper version.

This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects the problem and the expert will now receive these points; points verified.

Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.  If you are an EE Pro user, you can also choose Power Search to find all your open questions.

This is the Community Support link, if help is needed, along with the link to All Topics which reflects many TAs recently added.  You'll also find a link there for Experts who wish to participate in the cleanup effort of old and abandoned questions.
Thank you,
Moderator @ Experts Exchange
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.