[Oz] Open.socket, receive
Denys Duchier
Denys.Duchier at ps.uni-sb.de
Mon Feb 12 10:37:20 CET 2001
frehberg at cs.tu-berlin.de (Frank Rehberger) writes:
> I'm using the Open.socket object, and every time I'm doing a receive as
> shown in the code below my home-pc opens a phone-connection to my provider
> to contact the DNS.
> [...]
> Len = {Server receive(list:Data host:_ port:_ len:$)}
The problem is that OS.receiveFrom attempts to do more than you really
want. In your call, you are clearly not interested in host and port
information, but OS.receiveFrom always attempts to get and return this
information to you. To get the host information it needs to call
gethostbyname and that's when it invokes the DNS resolver.
I believe that, on Linux, you can get around this problem by having:
order hosts,bind
in your /etc/host.conf and adding appropriate entries in /etc/hosts
for the domain names that you will be `receiving' from. Ideally, of
course, OS.receiveFrom should be extended to not get the information
that you don't want (ooh! double negation! hard to figure out! :-).
This is actually easy to fix by extending the flags which may be
passed to OS.receiveFrom.
Please send a bug report to bugs at mozart-oz.org so that we don't forget :-)
Cheers,
--
Dr. Denys Duchier Denys.Duchier at ps.uni-sb.de
Forschungsbereich Programmiersysteme (Programming Systems Lab)
Universitaet des Saarlandes, Geb. 45 http://www.ps.uni-sb.de/~duchier
Postfach 15 11 50 Phone: +49 681 302 5618
66041 Saarbruecken, Germany Fax: +49 681 302 5615
-
Please send submissions to users at mozart-oz.org
and administriva mail to users-request at mozart-oz.org.
The Mozart Oz web site is at http://www.mozart-oz.org/.
More information about the mozart-users
mailing list