Re: MSDN page for "socket"

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Norman Diamond wrote:
> Page
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/socket_2.asp
> says:
>> Parameters
>> af
>> [in] Address family specification.
>
> But it gives no instructions on how to find a list of valid values.

Yet another MSDN bug. There are plenty of them out there and all other
platform docs (Unix man pages, Java documentation) have a lot of bugs too.
You can try to be a good citizen and report them or just live with them. ;-)

[...]

> It seems there are two ways to code programs using sockets. One is
> to do copying and pasting from previously written code. One is to
> read Linux manual pages.

Actually there are 4 ways. The third is to get a good book on socket
programming. The fourth is to use Internet ;-)

> But beware, the select() function doesn't
> do enough under Windows as it does under Linux (in Linux you can
> select() both a socket and the keyboard in order to respond to
> whichever input comes first).

Because on Linux select() is just a general OS API. Windows has a different
IO model which should be used if you want to mix sockets and other file
objects. The Winsock select is just an attempt to be compatible with BSD
sockets, not a POSIX implementation.

BTW if you want to have complete Unix compatibility, Cygwin or SFU provide
just that including select() that works for everything.

> Anyway, MSDN still needs much
> improvement in this area.

So do Linux man pages (not to mention Solaris ones which are even worse) ;-)
The bottom line is that developers don't like to write docs. Any API
documentation supplied by them will miss info and have bugs. If you want a
manual a book written by a dedicated writer is a better choice.


--
Eugene
http://www.gershnik.com


.



Relevant Pages

  • Re: How to increase the performance of lynxOS
    ... >I am using Lynx 4.0.0 and raw soxckets are at IP level. ... that raw IP sockets behave slightly differently on BSD-derived ... in the Linux stack. ...
    (comp.os.lynx)
  • Re: What blocks a write to a socket pair?
    ... local sockets unreliable is memory pressure you mentioned in another ... No. Linux can drop UDP packets for other reasons too. ... a specification they are documenting observed behavior. ...
    (comp.unix.programmer)
  • Re: Interprocess communication on multi-user machine
    ... Yes, I know about UNIX-domain sockets, but even when they give the ... Under Linux they ... I'm not aware of any *nix system worthy of the name where they are not. ...
    (comp.lang.python)
  • Re: Sockets and Forwarding On Java
    ... writing non-text characters from/to network sockets? ... sockets, and what came through one had to be copied over to the other, I ... stream while another one is writing to its input stream -- or with ... Linux when I tried that. ...
    (comp.lang.java.help)
  • RE: bill gates claim about security vulnerabilities per LOC inUn ix versus Windows
    ... From my experience every piece of software has bugs, ... bill gates' claim about security vulnerabilities per LOC ... > per LOC inUnix versus Windows ... Linux Gets A Reality Check ...
    (SecProg)