Solved

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

Posted on 1999-01-10
7
1,008 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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
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…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

757 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

21 Experts available now in Live!

Get 1:1 Help Now