Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 1999-01-10
7
Medium Priority
?
1,033 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 60 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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
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…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

597 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