Path: secnews.netscape.com!rls@netscape.com
From: Rob McCool
Newsgroups: netscape.devs-nsapi
Subject: Re: Socket Functions - docs & examples
Date: Wed, 27 Nov 1996 16:18:35 -0800
> I am attempting to port a customers CGI program into NSAPI. The CGI
> performs socket communications using function calls
>
> inet_addr
> gethostbyname
> socket
> connect
> write
> read
> close
>
> There seems to be a whole in your documentation for NSAPI, especially
> with respect to the functions declared int "net.h". Is there more
> documentation available?? Do you have any example functions such as
> "spew-forms" that perform socket comms??
Looking at the Programmers Guide, it does appear that some calls are not
documented when they should be. inet_addr and gethostbyname you should
continue to call yourself. net_socket works exactly as socket does, and
if you're using a 2.x server then net_connect does exactly what connect
does. read and write are called net_read and net_write, and they have
slightly different semantics. net_read() takes a timeout parameter which
tells the server how long to wait for any data to arrive. As soon as
data arrives it will return it, or return -1 with the error set.
net_write() is exactly like write() except that it guarantees that the
data will be delivered. net_close() functions exactly like close().
--Rob
--
Rob McCool, robm@netscape.com http://home.netscape.com/people/robm/
Stunt Programmer, Netscape Communications Corporation
It was working ten minutes ago, I swear...
Reproduced by permission of the author.