metaeducation / rebol-issues

6 stars 1 forks source link

Forward and reverse lookups using the DNS scheme don't work #1827

Open rebolbot opened 13 years ago

rebolbot commented 13 years ago

Submitted by: abolka

Previously, we could use dns:// to make forward and reverse lookups. The DNS scheme implementation currently available in R3 (A110) doesn't seem to provide any useful functionality at all. QUERY doesn't work on DNS ports (see #1826), READ just returns a port! object, and the scheme's AWAKE handler is never called.

As the hostkit side seems mostly implemented, it probably is a matter of the (native) actor implementation.

If this is only a matter of me using dns:// incorrectly, please change this bug to a documentation issue.

One workaround for forward lookups is to use a tcp:// port and QUERY the port's remote-ip.

>> type? read dns://rebol.com
== port!

>> type? read dns://205.134.252.23 
== port!

CC - Data [ Version: alpha 110 Type: Bug Platform: All Category: Ports Reproduce: Always Fixed-in:alpha 111 ]

rebolbot commented 13 years ago

Submitted by: Carl

By default on Win, the port was both low-level and async. So, READ was starting the DNS lookup, but returned immediately. If followed by a WAIT and a FIRST, the correct value was returned.

However, it is reasonable to assume that READ of an unopened DNS scheme should imply a WAIT and return the result, so that's now being done in A111.

However, I think there are a few problems lurking:

1. A time out period needs to be provided. Right now it is hardcoded to 20 sec.
2. A DNS signal event may be getting queued, but may not be processed properly for this case.
rebolbot commented 13 years ago

Submitted by: DideC

Timeout period was globally defined in R2 (system/schemes/default/timeout) and could be set in the port! object.

So for direct (sync) read, we could continue to use a global settings (everybody was fine with this I guess).

If we want to use a specific timeout value for each read, then :

1) we have to go the longest way : set the port! object values then make the read on it.
2) we need a refinment to specify the timeout value (ie: read/timeout or read/wait).

Making 2) is a bit "specific" for network, or we use a kind of "read/options" with a block of options values that will be set in the port object like [timeout: 10]. It could be usefull for other options that could be protocol specific.

rebolbot commented 13 years ago

Submitted by: abolka

Contrary to Carl's comment above, this behaviour did not generally change in A111. It was changed on Windows. But at least on Linux (and possibly OSX) we still get:

>> type? read dns://rebol.com
== port!
#1860 tracks this new cross-platform inconsistency.
rebolbot commented 11 years ago

Submitted by: abolka

Fixed in the 101.0 (08eb7e84cd) open source release.