Solved

Why error in win95 "socket( AF_INET, SOCK_STREAM, 0)"

Posted on 1999-01-10
7
1,011 Views
Last Modified: 2013-12-03
Hello. I get the error 10044 in Win95 when I use:

sock = socket( AF_INET, SOCK_STREAM, 0)

AF_INET is not supported, why ?
Is there anything I can do so it will work with out error ?

Have win95 OSR 3 ws2_32.dll from the beginning ?

0
Comment
Question by:devfredde
  • 3
  • 3
7 Comments
 
LVL 11

Expert Comment

by:alexo
ID: 1418384
Did you call WSAStartup() ?
0
 

Author Comment

by:devfredde
ID: 1418385
Yes.

      WSADATA WSAData;

      if (WSAStartup(0x101,&WSAData) == SOCKET_ERROR)
      {
            WSACleanup();
            PostQuitMessage(0);
      }

It works fine under Windows 98 but not under win95. I get the error 10044 in windows 95.

Have win95 OSR 2 ws2_32.dll from the beginning ???
What platform have es2_32.dll from the beginning ???
0
 

Accepted Solution

by:
wilsonkwan earned 20 total points
ID: 1418386
For IP sockets have you tried using
sock = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP)
or
sock = socket( AF_INET, SOCK_DGRAM, IPPROTO_UDP)?

If you are using Winsock 2 expanded protocol support try enumerating the protocols first with WSAEnumProtocols. This will at least give you an idea what protocols are available on your Win 95 platform.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 11

Expert Comment

by:alexo
ID: 1418387
wilsonkwan seems to be right, the last 0 equates to IPPROTO_IP which is definitely not a streaming (SOCK_STREAM) protocol.  Anyway, raw IP is very rarely used.

0
 

Author Comment

by:devfredde
ID: 1418388
alexo, do you meen that I can not use IPPROTO_IP with SOCK_STREAM ? I MSDN 98 OCT it only use SOCK_STREAM or SOCK_RAW and AF_INET for IP. And IPPROTO_IP is 0.

Should I try to use WSAEnumProtocols to see what protocol I can use ? I'm shore I have TCP/IP protocol on my win95 machine. It works perfect on my win98 and NT machine but not with win95.


0
 
LVL 11

Expert Comment

by:alexo
ID: 1418389
>> alexo, do you meen that I can not use IPPROTO_IP with SOCK_STREAM?
That's what I mean.  SOCK_STREAM with AF_INET sort of implies IPPROTO_TCP.
0
 

Author Comment

by:devfredde
ID: 1418390
Ok, I will try soon I have the book Winsock 2.0 and maybe I can learn more from it.


0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now