WSockLibrary>>gethostbyname:

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

WSockLibrary>>gethostbyname:

Steve Alan Waring
Hi,

Could WSockLibrary>>gethostbyname: be changed to an overlap call, (and
HOSTENT(class) be modified to use SocketError signalWith: Processor
activeProcess lastError).

Socket>>basicConnect sends #connect:name:namelen: to the WSockLibrary which
is an overlapped call, but typically gethostbyname is sent before (via
IN_ADDR>>address:)

This means that if there is a network problem that affects DNS,
Socket>>basicConnect will block the message loop.

On my dial up networking machine, if disconnected, evaluating:

    [(Socket port: 80 host: 'www.yahoo.com') connect] fork

will freeze all Dolphin windows for around 10 seconds. Changing the call to
overlapped fixes it.

Thanks,
Steve


Reply | Threaded
Open this post in threaded view
|

Re: WSockLibrary>>gethostbyname:

Blair McGlashan
"Steve Waring" <[hidden email]> wrote in message
news:[hidden email]...
> Hi,
>
> Could WSockLibrary>>gethostbyname: be changed to an overlap call, (and
> HOSTENT(class) be modified to use SocketError signalWith: Processor
> activeProcess lastError).
>...

Of course, unless anyone else has any objections (Bill?).

Blair


Reply | Threaded
Open this post in threaded view
|

Re: WSockLibrary>>gethostbyname:

Bill Schwab-2
Blair,

> > Could WSockLibrary>>gethostbyname: be changed to an overlap call, (and
> > HOSTENT(class) be modified to use SocketError signalWith: Processor
> > activeProcess lastError).
> >...
>
> Of course, unless anyone else has any objections (Bill?).

I think it's a great idea.  We've been doing this with #connect for some
time, so I think we should give it a shot.  My only complaint would be that
this might not be enough - I'd like to see all DNS lookups (number from name
as well as name from number) be overlapped.

I started to hack a solution to this a few times, and never really got going
because: (1) it's more complicated than #connect; (2) DNS problems are much
less common than problems reaching a peer PC; (3) see the next paragraph.

Ironically, I'm close to building an alternative to the database (DNS)
functions, because Windows has long been increasingly stubborn about
treating the local host differently in lookups, and it's now gotten to the
point that I can't find a workaround for Win2k configured via DHCP.  Win2k
machines appear not to query the name server re the local host; the result
is that the local machine is the only one on the planet that can't figure
out it's IP name.  It's easy to work around it on Win2k with a static IP
number: just name the machine such that the WINS name plus domain is the IP
name; but, that trick can't work when the IP number changes each time the
system boots.

Anybody know of a fix to this?

Have a good one,

Bill

---
Wilhelm K. Schwab, Ph.D.
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: WSockLibrary>>gethostbyname:

Blair McGlashan
"Bill Schwab" <[hidden email]> wrote in message
news:[hidden email]...

> Blair,
>
> > > Could WSockLibrary>>gethostbyname: be changed to an overlap call, (and
> > > HOSTENT(class) be modified to use SocketError signalWith: Processor
> > > activeProcess lastError).
> > >...
> >
> > Of course, unless anyone else has any objections (Bill?).
>
> I think it's a great idea.  We've been doing this with #connect for some
> time, so I think we should give it a shot.  My only complaint would be
that
> this might not be enough - I'd like to see all DNS lookups (number from
name
> as well as name from number) be overlapped.
>...

Sockets (and in fact all things to do with networks) are pretty opaque to
me, so if you'd like any other calls overlapped in D5, let me know. Any
suggestion to write a new sockets package using the blocking API through
overlapped calls will, unfortunately, have to be deferred to a future
release.

Regards

Blair