Questions tagged [erlang-ports]

56 questions
17
votes
1 answer

Converting Erlang-C port example to Erlang-Golang

I'm trying to write a Golang driver for Erlang, accesible via an Erlang port. I've started with the Erlang C port example, which works fine: http://www.erlang.org/doc/tutorial/c_port.html Now I'm trying to port the C code to Golang; just trying to…
Justin
  • 4,649
  • 6
  • 33
  • 71
15
votes
15 answers

Erlang machine stopped instantly (distribution name conflict?). The service is not restarted as OnFail is set to ignore

I am using RabbitMQ. For some reason the rabbitMQ service stops as soon as you start it. I saw following error in the event log: RabbitMQ: Erlang machine stopped instantly (distribution name conflict?). The service is not restarted as OnFail is set…
SharpCoder
  • 18,279
  • 43
  • 153
  • 249
8
votes
1 answer

C and Erlang: Erlang Port example

Disclaimer: The author of the question has an average knowledge of Erlang and a basic knowledge of C. I am reading the Interoperability Tutorial User Guide now. I have successfully compiled the complex.c example and it works with the Erlang Port…
skanatek
  • 5,133
  • 3
  • 47
  • 75
7
votes
1 answer

State of Erlang and C/C++ integration?

If we check the official documentation we can find various ways of interfacing Erlang and C/C++. A similar question was asked here in 2009 and I would like to know how the things changed since then. Is there any mature stable library that does all…
skanatek
  • 5,133
  • 3
  • 47
  • 75
6
votes
1 answer

Erlang: robustness against port owner's death

What happens when the process which owns a spawned port dies and is restarted by the supervisor? Is there a way for the old port not to die with its owner and for the new owner to "take over"? Failing that, is it possible to ensure that the…
Alexey Romanov
  • 167,066
  • 35
  • 309
  • 487
5
votes
2 answers

What is the fastest and easiest way to call a C function from Erlang via ports?

Francesco Cesarini's "Erlang Programming" book provides a nice and simple-to-start-with example of connecting Erlang to Ruby (implemented through ports): module(test.erl). compile(export_all). test() -> Cmd = "ruby echoFac.rb", Port =…
skanatek
  • 5,133
  • 3
  • 47
  • 75
5
votes
3 answers

Restarting an Erlang node after a segmentation fault

I'm currently running an Erlang application that is running C code through Nifs. However, if a segmentation fault occurs within the C code, the entire node goes down, as well as the Erlang virtual machine that the Erlang application was running…
Lee Torres
  • 561
  • 1
  • 5
  • 19
4
votes
2 answers

Shell script behaves strangely when called via an Erlang port

When calling shell scripts from Erlang, I generally need their exit status (0 or something else), so I run them using this function: %% in module util os_cmd_exitstatus(Action, Cmd) -> ?debug("~ts starting... Shell command: ~ts", [Action,…
Alexey Romanov
  • 167,066
  • 35
  • 309
  • 487
3
votes
0 answers

Is it possible in Erlang to use open_port in Windows?

Background: I was given a task for college to implement an elevator's source code for an Arduino UNO with a user interface shield that contains: a 7-Segment display and a total of 8 buttons, one for each floor plus two to control the doors. The…
3
votes
1 answer

Erlang server connecting with ports to send and receive a Json file to a Java application

I have tried to implement a server with Erlang to my Java application. Seems that my server is working, but still full of bugs and dead points. I need to receive a JSON file parsed by the Java application into a map and send it back to all clients,…
Laiz
  • 33
  • 4
3
votes
1 answer

What is the best way of doing computationally intensive tasks in Erlang w/o scalability sacrifices?

Erlang Interoperability guide discusses different interoperability mechanisms. Here are my conclusions: Ports and Erl_Interface programs: OS scheduled, limit scalability. Port Drivers: dangerous because a crash in the port driver brings…
spc16670
  • 504
  • 6
  • 15
3
votes
1 answer

Erlang: Interfacing with Xalan: port driver or nif?

I'd like to get a real XSLT processor working with erlang. Which would be the best interface, nif or port driver? According to the nif documentation, nif calls block the runtime, so they should not take long. Is processing a long xml document too…
mwt
  • 175
  • 6
3
votes
1 answer

Erlang : Tcp Server

Hi I am a new bee in Erlang but managed to create a simple TCP server which accepts client in passive mode and displays message. I spawn a new process every time new client connects to the server. Is there a way I could send message to the client…
Rs9766
  • 173
  • 2
  • 11
2
votes
3 answers

How do I connect Erlang to C++?

I have written a very simple C++ piece of code: #include using namespace std; int main() { int message; cin >> message; cout << message; return 0; } I have tested it in the shell - it returns a value which was input in the shell. But…
skanatek
  • 5,133
  • 3
  • 47
  • 75
2
votes
1 answer

OpenCV on Erlang

I would like to use OpenCV in my Erlang application. One solution would be to write an Erlang port etc., but I'm sure it has been done before. The ideal result would be to be able to configure OpenCV from Erlang, and never touch a line of C code.…
Blacksad
  • 14,906
  • 15
  • 70
  • 81
1
2 3 4