caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] dns client
@ 2003-09-25 15:35 Anastasia Gornostaeva
  2003-09-25 15:51 ` Richard Jones
  2003-09-25 16:18 ` Eric C. Cooper
  0 siblings, 2 replies; 5+ messages in thread
From: Anastasia Gornostaeva @ 2003-09-25 15:35 UTC (permalink / raw)
  To: caml-list

Hello.

Is there any dns client written on Ocaml? At least i want to get records with
specified types such as A, NS, MX, etc.
I cannot write a wrapper to C library, i'm afraid about GC problems.
Thanks. 

ermine

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] dns client
  2003-09-25 15:35 [Caml-list] dns client Anastasia Gornostaeva
@ 2003-09-25 15:51 ` Richard Jones
  2003-09-25 16:17   ` Anastasia Gornostaeva
  2003-09-25 16:18 ` Eric C. Cooper
  1 sibling, 1 reply; 5+ messages in thread
From: Richard Jones @ 2003-09-25 15:51 UTC (permalink / raw)
  To: Anastasia Gornostaeva; +Cc: caml-list

On Thu, Sep 25, 2003 at 07:35:29PM +0400, Anastasia Gornostaeva wrote:
> Hello.
> 
> Is there any dns client written on Ocaml? At least i want to get records with
> specified types such as A, NS, MX, etc.
> I cannot write a wrapper to C library, i'm afraid about GC problems.

If you really don't want to write a wrapper, how about using an
external program, eg:

let chan = Unix.open_process_in "host -t mx ibm.com"
(* some code to parse the 7th field of the response - eg. using Pcre *)

However writing C wrappers couldn't really be much simpler with OCaml
(compare it to Perl or Java some time!).

Rich.

-- 
Richard Jones. http://www.annexia.org/ http://freshmeat.net/users/rwmj
Merjis Ltd. http://www.merjis.com/ - all your business data are belong to you.
 All new technology is irrelevant until it is taken up by the public.

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] dns client
  2003-09-25 15:51 ` Richard Jones
@ 2003-09-25 16:17   ` Anastasia Gornostaeva
  2003-09-25 17:15     ` Richard Jones
  0 siblings, 1 reply; 5+ messages in thread
From: Anastasia Gornostaeva @ 2003-09-25 16:17 UTC (permalink / raw)
  To: caml-list

On Thu, Sep 25, 2003 at 04:51:19PM +0100, Richard Jones wrote:
> On Thu, Sep 25, 2003 at 07:35:29PM +0400, Anastasia Gornostaeva wrote:
> > Hello.
> > 
> > Is there any dns client written on Ocaml? At least i want to get records with
> > specified types such as A, NS, MX, etc.
> > I cannot write a wrapper to C library, i'm afraid about GC problems.
> 
> If you really don't want to write a wrapper, how about using an
> external program, eg:
> 
> let chan = Unix.open_process_in "host -t mx ibm.com"
> (* some code to parse the 7th field of the response - eg. using Pcre *)

Well, it is an interesting solution. but what about portability?
I saw, Erlang/OTP has more nice solution - a module inet_res that allows some
kinda of my requests above.
 
> However writing C wrappers couldn't really be much simpler with OCaml
> (compare it to Perl or Java some time!).

I know, I ask here for ready solutions :)

ermine

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] dns client
  2003-09-25 15:35 [Caml-list] dns client Anastasia Gornostaeva
  2003-09-25 15:51 ` Richard Jones
@ 2003-09-25 16:18 ` Eric C. Cooper
  1 sibling, 0 replies; 5+ messages in thread
From: Eric C. Cooper @ 2003-09-25 16:18 UTC (permalink / raw)
  To: caml-list

On Thu, Sep 25, 2003 at 07:35:29PM +0400, Anastasia Gornostaeva wrote:
> Is there any dns client written on Ocaml? At least i want to get
> records with specified types such as A, NS, MX, etc.  I cannot write
> a wrapper to C library, i'm afraid about GC problems.

An easy, Unix-specific approach, but probably not the highest performance:
    Unix.open_process_in "dig ..."

-- 
Eric C. Cooper          e c c @ c m u . e d u

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] dns client
  2003-09-25 16:17   ` Anastasia Gornostaeva
@ 2003-09-25 17:15     ` Richard Jones
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Jones @ 2003-09-25 17:15 UTC (permalink / raw)
  To: Anastasia Gornostaeva; +Cc: caml-list

On Thu, Sep 25, 2003 at 08:17:08PM +0400, Anastasia Gornostaeva wrote:
> Well, it is an interesting solution. but what about portability?
> I saw, Erlang/OTP has more nice solution - a module inet_res that allows some
> kinda of my requests above.

Well there are two issues here: how much portability do _you_ need?
and how portable would bindings to a C library be?

If you specifically need this to work on multiple (Unix + non-Unix)
systems, then using open_process_in/popen wouldn't be the way to
go. However I cannot answer that question, only you can.

Would C bindings to the bind resolver library be any more portable I
wonder? (Actually I don't have the faintest clue whether this library
is available on Windows).

A pure OCaml resolver library would be a massive chunk of work, and
pretty pointless to boot.

Rich.

-- 
Richard Jones. http://www.annexia.org/ http://freshmeat.net/users/rwmj
Merjis Ltd. http://www.merjis.com/ - all your business data are belong to you.
MONOLITH is an advanced framework for writing web applications in C, easier
than using Perl & Java, much faster and smaller, reusable widget-based arch,
database-backed, discussion, chat, calendaring:
http://www.annexia.org/freeware/monolith/

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-09-25 17:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-25 15:35 [Caml-list] dns client Anastasia Gornostaeva
2003-09-25 15:51 ` Richard Jones
2003-09-25 16:17   ` Anastasia Gornostaeva
2003-09-25 17:15     ` Richard Jones
2003-09-25 16:18 ` Eric C. Cooper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).