jinterface and erlang node

tty <>
Wed Feb 2 22:59:11 CET 2005


Thanks Tobbe,

I took a look at it although its not what I need at the moment. 

Although I mention Java client, this client is really a bridge. What I intend to do is as below:


  Erlang Server <---> Java Client <---> Java Server

An Erlang server driving a Java client which injects
requests to a Java server. The Java server may send
responses back to the Java client which in turn has to inform the Erlang server. Both Java client and Java server have been written.

I'll be modifying the Java client to talk to the Erlang server and I decided to go with one of two options (Erlang port or jinterface). I was hoping I could use jinterface as it seems the easiest in terms of communication protocol and appears as an Erlang node (with those added benefits).

Thanks all the same. I am of the opinion that I can never see enough sample code!

Regards

tee

-------- Original Message --------
From: Torbjorn Tornkvist <>
To: 
Cc: 
Subject: Re: jinterface and erlang node
Date: Wed, 02 Feb 2005 22:35:02 +0100

> 
> I assume it is the Java client that connects to the Erlang server ?
> I've written a simple chat-application in the form of a Java applet
> that talks to an Erlang server. It works nice with Yaws and Erlang-R9
> and is using xml-rpc for the communication. If you think it could be
> useful to study, then you'll find it here:
> 
>   http://www.tornkvist.org/echat.tgz
> 
> Cheers, Tobbe
> (Ps. It doesn't work with R10 because of a missing test in ucs.erl which
> I reported earlier today. BTW: did that mail vanish ?)
>  
> 
>  wrote:
> 
> >Hello,
> >
> >I'm prototyping an Erlang server which needs to connect with an existing Java client. For simplicity I'm using a simple 'echo' server. I converted a simplified Java client into an Erlang node using jinterface. Unfortunately at this point I am unable to send/receive messages from the Erlang server.
> >
> >My Java code starts as:
> >              ---------------------
> >node = new OtpNode("java_client");
> >mbox = node.createNode("client1");
> >
> >// the following returns true
> >node.ping("server", 100);
> >
> >              ---------------------
> >
> >The Erlang server is globally registered as 'echo_srv'.
> >If I do a net_adm:world() I see '' and I can net:ping it.
> >
> >I also wrote an Erlang client which was successful in sending/receiving messages from 'echo_srv'.
> >
> >How do I go about sending/receiving messages using jinterface ? 
> >
> >The steps seem to involve creating a OtpErlangPid which requires a PID in external format (how can I get this) or from a node, id, serial, creation tuple (what are these, in particular id, serial, 
> >creation ?).
> >
> >Any hints/code fragments are welcome. 
> >
> >Thanks
> >
> >tee
> >
> >
> >
> >
> >
> >
> >  
> >







More information about the erlang-questions mailing list