Solved

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

Posted on 1999-01-10
7
1,013 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
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 Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

829 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