Convert C types to Erlang types

Paroli, Bernardo <>
Fri Dec 6 18:50:40 CET 2002

I'm make a server socket in Erlang and I send message from C client. The C client send the next message:

typedef struct
	int first;
	char second;
} Message;

char buf[1024];
p = (Message*) buf;

p->first   = 1567;
p->second = 's';

send(s, buf, sizeof(Message), 0);

In the Erlang server I'm receive the next binary message:

I need convernt this structure to the corresponding C structure. Exist in Erlang something function to make this conversion?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the erlang-questions mailing list