ErLang newbie questions

Raimo Niskanen raimo@REDACTED
Mon Aug 19 08:22:33 CEST 2002


Hi.

I am sorry that I do not understand your questions. Have you got Erlang
nodes or C nodes or both?

An Erlang node is a OS(Unix/Windows) process that is started with "erl
-sname ..." and runs mostly Erlang code (compiled to .beam).

A C node is a OS process that runs a program written in C using the 'ei'
(or perhaps 'erl_interface') support library that helps the C program
behave like an Erlang Node.

A C node cannot use driver callbacks. It can only use the 'ei' support
library (and OS calls, of course). The driver callbacks are used by
linked-in drivers, and port_command/2 is an Erlang code call into a
linked-in driver.

A linked-in driver is an object file that is dynamically loaded from an
erlang node using calls to the 'erl_ddll' module, and then can be used
as a port, for example open_port({spawn, "linked_in_driver_name}, []),
and later port_command/2.

I hope this helps you rephrase your questions.

/ Raimo Niskanen, Erlang/OTP, Ericsson AB.




> Sivakumar Krishnasamy wrote:
> 
> Hi All,
>      I am sorry if all these questions are very basic. I am a newbie
> to ErLang. Please clarify my questions.
> 
> 1) I want to use Port driver's callback function in a C Node. To call
> back this function I need to use port_command/3 BIF from ErLang Node.
> But I am able to find port_command/2 BIF only. What are arguments in
> port_command/3 BIF?
> 
> 2) I have two ErLang nodes  (For example) Node_A , Node_B. Both these
> nodes have C Node Interface.
> 
>      I have written a ErLang process which sends a message from ErLang
> process to C Interface program in Node_A, which is then echo'd  back
> to ErLang process, which in turn send this message to ErLang process
> in Node_B.
> 
>    Message communication between these two nodes are normal. But when
> I disconnect a node (Node_B) and try sending a message to the Node_B
> from Node_A, it fails by giving proper error. But when the connection
> is retained back (to Node_B), Node_A sends the old messages, i.e the
> messages which were send to Node_B, when it was disconnected from
> Node_A. I think somekind of Message queuing  is happening in Node_A.
> How to prevent this?.  Is this queuing happening in Node_A's C
> Interface ?? (or) is it by ErLang process in Node_A?.
> 
> 3) Why does open_port({spawn,command},[{packet,2},binary]) fails while
> open_port({spawn,command},[{packet,2}]) succeeds ?.
> 
>    Thanks in Advance.
> 
> Regards,
> Sivakumar Krishnasamy.
> 
> 
> 
> 
>



More information about the erlang-questions mailing list