Erlang/OTP Forums

Author Message

<  Erlang questions mailing list  ~  Unix and NT communicating?

hal at enteract.com
Posted: Mon Jan 11, 1999 2:59 am Reply with quote
Guest
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.

On the main web site, at http://www.erlang.org/download.html it says
of the "Windows user" Erlang kit:

Note the distribution protocol used in this release is incompatible
with that used in the Unix release - this will be corrected in the
next release.

Is the "distribution protocol" the protocol used for inter-host
communication?

Because at http://www.whatis.com/erlang.htm they say

Erlang's bytecode is identical on all platforms, and a network of
Erlang nodes may consist of any mix of NT, UNIX, or other supported
platforms.

* * *

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?


Thanks.

Hal


Post generated using Mail2Forum (http://m2f.sourceforge.net)
tobbe at serc.rmit.edu.au
Posted: Mon Jan 11, 1999 3:54 am Reply with quote
Guest
> 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 Wink IG documentation can be found at:

http://www.serc.rmit.edu.au/~tobbe/ig.html

/Tobbe







Post generated using Mail2Forum (http://m2f.sourceforge.net)
joe at erix.ericsson.se
Posted: Mon Jan 11, 1999 8:20 am Reply with quote
Guest
On 10 Jan 1999, Hal Snyder wrote:

> 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.
>
> On the main web site, at http://www.erlang.org/download.html it says
> of the "Windows user" Erlang kit:
>
> Note the distribution protocol used in this release is incompatible
> with that used in the Unix release - this will be corrected in the
> next release.
>
> Is the "distribution protocol" the protocol used for inter-host
> communication?
>
Yes

> Because at http://www.whatis.com/erlang.htm they say
>
> Erlang's bytecode is identical on all platforms, and a network of
> Erlang nodes may consist of any mix of NT, UNIX, or other supported
> platforms.
>

Sorry for the confusion. Let me explain in more detail...

All Erlang nodes (a node is a complete Erlang system running on
some platform) can communicate in a transparent manner. For example on
an NT machine you could send a arbitrary Erlang message to any other
machine (solaris, freeBSD etc).

A couple of weeks before the OSE release we discovered a security
hole in the system and changed the implementation to deal with this.

We got as far as making the changes for the unix systems, but NOT
for the WIN32 systems. So all the unix systems CAN talk transparently
to each other but they will not be able to talk to the WIN32 system.

The Win32 build is more painful than the unix build so we
distributed the unix source + makefiles (with the new security fixed
protocol) and the win32 binaries (with the old protocol). These two
systems cannot talk to each other.

Last week tony (tony_at_cslab.ericsson.se) successfully built the
win32 system so that it can talk to the unix systems... We will put
this on the web site ASAP. Mail tony for more info.

> * * *
>
> 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?

See tobbe's answer

/Joe

--
Joe Armstrong Computer Science Laboratory +46 8 719 9452
AT2/ETX/DN/SU Ericsson Telecom SE-126 25 Stockholm Sweden
joe_at_cslab.ericsson.se http://www.ericsson.se/cslab/~joe








Post generated using Mail2Forum (http://m2f.sourceforge.net)

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum