Archived

This topic is now archived and is closed to further replies.

Shannon Barber

socket API half-baked?

Recommended Posts

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!]

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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.

Share this post


Link to post
Share on other sites
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!]

Share this post


Link to post
Share on other sites
quote:
Original post by Dire.Wolf
[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?

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...

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
quote:
Original post by HJB417
It is nice that microsoft has created these functions though, it makes programming easier.

It isn''t nice. It''s their duty.

quote:
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. =)

Not possible. Which is one of the issues being debated here. It''s absolutely impossible to go "back" and modify the 9x kernel (OS recalls?!), and therefore the binary interface remains limited. Of course, DLLs alleviate some of this, but even those are limited by the underlying OS functionality.

quote:
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

If that''s a .sig...

[ GDNet Start Here | GDNet FAQ | MS RTFM | STL | Google ]
Thanks to Kylotan for the idea!

Share this post


Link to post
Share on other sites
it is my sig, should I add a line seperator or something. Also, you guys are all over microsoft about this, but tell me this, does linux offer the same functions, like 1 function that can do filetransfers or URL downloads automatically? Or do you have to make your own? I'm just saying, cut microsoft some slack. I'm still new to winsock, but I thought the primary purpose of winsock was to provice the basic sockets access to windows systems. I wouldn't call it half baked either.

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

Edited by - HJB417 on January 15, 2002 3:01:46 PM

Edited by - HJB417 on January 15, 2002 4:18:10 PM

Share this post


Link to post
Share on other sites
quote:
Original post by HJB417
it is my sig, should I add a line seperator or something. Also, you guys are all over microsoft about this, but tell me this, does linux offer the same functions, like 1 function that can do filetransfers or URL downloads automatically?

Firstly, Linux is a kernel. Secondly, making the assumption that you mean "unix libraries available" by "does linux support," the answer is yes.

[Resist Windows XP''s Invasive Production Activation Technology!]

Share this post


Link to post
Share on other sites
What I _dislike_ about the API is that the functionality is incomplete and inconsistent. It don't care so much about what the functions are called - so long as the function that does what I want exist! Like ConnectEx is brand spanking new for XP! Com'on, like no one ever wanted to establish a connection asyncronously using overlapped IO/IOCP. Isn't the desire for that functionality _obvious_?

Edited by - Magmai Kai Holmlor on January 16, 2002 6:13:42 PM

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by HJB417
nice find Null and Void. When I said linux, I meant the linux sockets header file.

Edited by - HJB417 on January 15, 2002 9:07:17 PM


Linux is a /kernel./ Not a development environment. What you probably should ask is ''Does Redhat support...'' or ''Does Slackware support...''

Redhat and Slackware are operating _systems_ Linux is a kernel. It doesn''t do much by itself, just as the windows kernel doesn''t do much without the rest of the OS.

Share this post


Link to post
Share on other sites