Unix and NT communicating?
Torbjorn Tornkvist
tobbe@REDACTED
Mon Jan 11 04:53:43 CET 1999
> I'm probably misreading something. The question is, can Erlang systems
> running on Unix and Win32 communicate? For example, I'm considering
> connecting FreeBSD and Windows 95 systems running erlang.
Ok, there is a little confusion here what we mean when we
talk about communicating between Unix and Windows using Erlang.
-----
Using the Erlang built-in support to communicate between two
or more Erlang nodes (which may be running on different platforms
such as Unix, Windows, etc...), means that we can, from one Erlang
node, spawn a new Erlang process on another Erlang node, send messages
to an other Erlang node, setup links to other Erlang nodes etc...
This mechanism uses the built-in Erlang distribution protocol (which
runs on top of TCP). As it seems *today*, there are inconsistent versions
of the distribution protocol for the Unix and Window port of Erlang.
This makes it not possible to communicate between such Erlang nodes.
This is probably a very easy fix, which (again probably) will be
provided real soon now... (?)
-----
The other way to communicate between different Erlang nodes is
to use the Socket support. See the Erlang man pages for the Erlang
modules gen_tcp and gen_udp for how to setup TCP/UDP connections
to other Erlang nodes (or other TCP/UDP software).
-----
> Second question: what's the best way to do device control from Erlang?
> Suppose I wanted to talk to some PC telephony devices, e.g. Dialogic
> cards?
I know that this has been done using Dialogics card, so someone
will probably come with a more elaborated answer.
Basically, you write a C program which you start from Erlang with
the open_port/2 BIF. The C program relays the data sent between
your device and your Erlang node. This C program can either be
run as a stand-alone program (e.g in a separate Unix process)
or as an Erlang linked in driver. (My advice is to first develop
and test it as a stand-alone program)
This Erlang/C interface can be written by hand or be generated
(more or less) automatically using the IC or the IG application.
See the documentation. I have myself only used IG (the Interface
Generator) and can give you more feedback on how to use it if needed.
Some old (but nice ;-) IG documentation can be found at:
http://www.serc.rmit.edu.au/~tobbe/ig.html
/Tobbe
More information about the erlang-questions
mailing list