c++ - Communicating between qt application and erlang server via erlang port -


i need make client (qt c++) , server (erlang) in ubuntu. server should generic otp server. client should connect server , send data (string) , erlang srv should return same string.

please suggest me example code or skeleton implement things.

i decided start this:

connect(message) ->     cmd = "./myqtwindowapp \n",     port = open_port({spawn,cmd}, [stream,use_stdio,exit_status]),     payload = string:concat(message, "\n"),     erlang:port_command(port, payload),     receive         {port, {data, data}} ->             ?dbg("received data: ~p~n", [data]);         other ->             io:format("unexpected data: ~p~n", [other]);         after 15000 ->             ?dbg("received nothing~n", [])     end. 

please me client , server.

you should use ipc make communication. can open socket (gen_tcp) or use d-bus instance. qt have proper classes handle sockets , d-bus.


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -