Erlang, C, IC and asyncronous servers/clients

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Erlang, C, IC and asyncronous servers/clients

Jouni Rynö-2
The current IC-system seems to generated code only for cases, were
communication is initiated from only one side. I would need to port
some older code, which used IG in more asynchronous way (yes, I know,
it was not completely safe).

In detail I have
Erlang side                C side
raw telemetry    ->     data processing, packet detection
                        when packet found from raw telemetry
                 <-       packet_type_X
                 <-       packet_type_Y
                 <-         up to N packets

C-process receives binary chunks from Erlang, whenever it finds a
valid, complete packet, it sends it to Erlang-process for further
distribution. The catch is, there's n packets to generate, so simple
function return values is not adequate.

At least the IC examples for C-server and -client don't allow this kind
of two-way message sending.

So to put it simply, is there a way to do it ?

(and yes, the I could the processing in Erlang, but we also have to
give out source code for colleagues to analyze data later. Erlang is
used in real time situation )



  Jouni Ryn?                            mailto://Jouni.Ryno/
                                        http://www.geo.fmi.fi/~ryno/
  Finnish Meteorological Institute      http://www.fmi.fi/
  Geophysical Research                  http://www.geo.fmi.fi/
  P.O.BOX 503                           Tel   (+358)-9-19294656
  FIN-00101 Helsinki                    GSM   (+358)-50-5302903
  Finland                               FAX   (+358)-9-19294603
 
  "It's just zeros and ones, it cannot be hard"






Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Erlang, C, IC and asyncronous servers/clients

Niclas Eklund-2

Hello!

Can't you define the function to be oneway and add a new function which
send the N packets back to the Erlang side? If not, you must search for
all complete packets and return them in a sequence. The last option is to
use the C-interface directly, i.e., not via IC.

/Nick

On Wed, 21 Feb 2001, Jouni Ryno wrote:

> The current IC-system seems to generated code only for cases, were
> communication is initiated from only one side. I would need to port
> some older code, which used IG in more asynchronous way (yes, I know,
> it was not completely safe).
>
> In detail I have
> Erlang side                C side
> raw telemetry    ->     data processing, packet detection
>                         when packet found from raw telemetry
>                  <-       packet_type_X
>                  <-       packet_type_Y
>                  <-         up to N packets
>
> C-process receives binary chunks from Erlang, whenever it finds a
> valid, complete packet, it sends it to Erlang-process for further
> distribution. The catch is, there's n packets to generate, so simple
> function return values is not adequate.
>
> At least the IC examples for C-server and -client don't allow this kind
> of two-way message sending.
>
> So to put it simply, is there a way to do it ?
>
> (and yes, the I could the processing in Erlang, but we also have to
> give out source code for colleagues to analyze data later. Erlang is
> used in real time situation )




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Erlang, C, IC and asyncronous servers/clients

Kenneth Lundin-2
In reply to this post by Jouni Rynö-2
Hi,

I think there is an easy solution where you define 2 interfaces, one for
each
direction and use the same transportation channel for both.

/Kenneth

Jouni Ryno wrote:

>
> The current IC-system seems to generated code only for cases, were
> communication is initiated from only one side. I would need to port
> some older code, which used IG in more asynchronous way (yes, I know,
> it was not completely safe).
>
> In detail I have
> Erlang side                C side
> raw telemetry    ->     data processing, packet detection
>                         when packet found from raw telemetry
>                  <-       packet_type_X
>                  <-       packet_type_Y
>                  <-         up to N packets
>
> C-process receives binary chunks from Erlang, whenever it finds a
> valid, complete packet, it sends it to Erlang-process for further
> distribution. The catch is, there's n packets to generate, so simple
> function return values is not adequate.
>
> At least the IC examples for C-server and -client don't allow this kind
> of two-way message sending.
>
> So to put it simply, is there a way to do it ?
>
> (and yes, the I could the processing in Erlang, but we also have to
> give out source code for colleagues to analyze data later. Erlang is
> used in real time situation )
>
>   Jouni Ryn?                            mailto://Jouni.Ryno/
>                                         http://www.geo.fmi.fi/~ryno/
>   Finnish Meteorological Institute      http://www.fmi.fi/
>   Geophysical Research                  http://www.geo.fmi.fi/
>   P.O.BOX 503                           Tel   (+358)-9-19294656
>   FIN-00101 Helsinki                    GSM   (+358)-50-5302903
>   Finland                               FAX   (+358)-9-19294603
>
>   "It's just zeros and ones, it cannot be hard"

--
Kenneth Lundin              Ericsson Utvecklings AB
kenneth     ?T2/UAB/F/P
                            BOX 1505
+46 8 727 57 25    125 25 ?lvsj?


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

INETS Question

David W. Bauer Jr.
I am trying to POST a form to INETS and was curiosu to know what Inets
would do with large amounts of content.  Can I always rely upon getting
data in one large chunk from the server into my module?

Specifically, here is my fun:

fun(Env, Input) ->
        Input = httpd:parse_query(Input).
         
This should return to me the following according to the documentation:

ServerRet = [{Key,Value}]

When I make this POST:

POST /exchange/erl/api/exml HTTP/1.0\r
Accept: */*\r
User-Agent: Mozilla\r
Content-Length: 5\r
\r
dave
LF

I get Key = "dave\n", Value = [].  But what if the content where very
large?

Thanks,
David


                                               ~~~  ~~  ~~~~     _o
  URL: http://www.david-bauer.com             ~~~  ~~~~ ~~    _'|<,_
                                         ~~~~ ~~~   ~~~~     (*)/ (*)






Loading...