socket API half-baked?

Started by
15 comments, last by Shannon Barber 22 years, 3 months ago
I was just curious if I was the only one that thought Winsock and even bsd sockets were a half-baked API?
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
Advertisement
It''s come to my mind also. BSD sockets (and, due to its derivation, WinSock as well) have a somewhat inconsistent syntax style that makes it just feel weird . I''m not sure of the history of their development, so I can''t really speculate as to why that''s so.

[Resist Windows XP''s Invasive Production Activation Technology!]
I think it''s safe to assume an organic life cycle. Makes a good example case for CS students on what _not to do...

What''s even better is the M$ documentation is all together, so it''s never clear which functions are compatible with each other...

I wish they''d done the whole hookie bsd sockets. Then done a full WSA API ignoring the bsd API. Then added a full asycronous version using the tried&true xxxxxxxxEx format... As is a third the functions only work on NT, a couple (_really useful ones_) only work on XP, and each fragment of the Winsock2 API only implements a portion of the fucntions you need so you have to use some from other fragments... all of which are inconsisent on how they behave. Some of which can change thier behavior depending upon which functions you''ve called in another fragment - like WSAEventSelect affects all the bsd style functions, not just the WSA ones.

It means there''s about thirty ways to establish a connection, with no clear trade-offs between them all to make a good decision about which method to use...
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
On a related note, has anyone here tried out HawkNL? Is it cleaner than BSD/Windows Sockets?
Dirk =[Scarab]= Gerrits
quote:
...As is a third the functions only work on NT, a couple (_really useful ones_) only work on XP,


You mean extremely useful functions like ConnectEx and DisconnectEx?



Dire Wolf
www.digitalfiends.com
[email=direwolf@digitalfiends.com]Dire Wolf[/email]
www.digitalfiends.com
quote:Original post by Null and Void
It''s come to my mind also. BSD sockets (and, due to its derivation, WinSock as well) have a somewhat inconsistent syntax style that makes it just feel weird . I''m not sure of the history of their development, so I can''t really speculate as to why that''s so.


BSD sockets are consistent with the way file I/O functions on bsd systems worked. Since not many of us use the old style file reading and writing, BSD sockets now look like a singular beast, but they did make good sense at the time.
quote:Original post by Anonymous Poster
BSD sockets are consistent with the way file I/O functions on bsd systems worked. Since not many of us use the old style file reading and writing, BSD sockets now look like a singular beast, but they did make good sense at the time.

Actually, I have worked some with the BSD/POSIX I/O libraries. I understand a couple things being done in ''weird'' ways (like the close function) since unixes close almost everything with that function. I just don''t understand a couple of their structure arangment things (why do you have to go digging through the struct''s sometimes, for example) as well as some of the structure (and member) naming conventions being pretty weird.

[Resist Windows XP''s Invasive Production Activation Technology!]
quote:Original post by Dire.Wolf

…As is a third the functions only work on NT, a couple (_really useful ones_) only work on XP,


You mean extremely useful functions like ConnectEx and DisconnectEx?

Yes! as well as TransmitPackets - and TransmitFile doesn''t work on 95.

I can''t imagine the convolutions in writing a 9x and NT driver…

- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
Writing a robust and efficient network server program for Windows 9x/NT isn''t fun. You can abstract the details away but you basically end up choosing I/O Completion functions in 9x and IOCP in NT/2000/XP. I''m so glad Microsoft is doing away with the 9x/Me kernel.

People can dislike XP for whatever reasons but they can''t deny that it really makes a programmers job easier



Dire Wolf
www.digitalfiends.com
[email=direwolf@digitalfiends.com]Dire Wolf[/email]
www.digitalfiends.com
I''ve been reading about/learning winsock 1.1 for about a week now and it''s really good stuff. The winsock functions don''t seem to be different than their BSD counterparts, but I''m also doing console application programs, I don''t know windows programming but that transmitfile functions looks really cool, but you have to also recognize that that''s just a function that performs a common routine. There''s always the send() recv() fread()fwrite() loop =)It is nice that microsoft has created these functions though, it makes programming easier. It would also be nice if they could make it compatible with all versions of windows too becuase that transmit file would make my winsock newbie life easier. =)

One problem with the programmer''''s mentality is insecurity. This goes deep. An insulting college litany says that failed mathematicians become computer programmers. They are also ridiculed for being nerdy losers, for being too fat or too skinny, and for having few social skills. Most programmers can be spotted easily in a crowd. Nobody really wants to hang out with them. Put thousands of these people in one company and if you can get them to work, you become a billionaire. -John C. Dvorak
--------------------------One problem with the programmer''s mentality is insecurity. This goes deep. An insulting college litany says that failed mathematicians become computer programmers. They are also ridiculed for being nerdy losers, for being too fat or too skinny, and for having few social skills. Most programmers can be spotted easily in a crowd. Nobody really wants to hang out with them. Put thousands of these people in one company and if you can get them to work, you become a billionaire. -John C. Dvorak

This topic is closed to new replies.

Advertisement