Rework transport protocol

Use a more simple tranport protocol for the realtime data. Use a piece
of shared memory and a socket where we use a 1byte read/write to trigger
remote actions. Also use a ringbuffer for events.
This commit is contained in:
Wim Taymans 2016-11-07 10:24:13 +01:00
parent 7e46f9e3ad
commit b774b99db5
22 changed files with 797 additions and 364 deletions

View file

@ -630,6 +630,12 @@ pinos_connection_parse_message (PinosConnection *conn,
connection_parse_port_command (conn, message);
break;
case PINOS_MESSAGE_TRANSPORT_UPDATE:
if (conn->in.size < sizeof (PinosMessageTransportUpdate))
return false;
memcpy (message, conn->in.data, sizeof (PinosMessageTransportUpdate));
break;
case PINOS_MESSAGE_INVALID:
return false;
}
@ -781,6 +787,11 @@ pinos_connection_add_message (PinosConnection *conn,
connection_add_port_command (conn, message);
break;
case PINOS_MESSAGE_TRANSPORT_UPDATE:
p = connection_add_message (conn, type, sizeof (PinosMessageTransportUpdate));
memcpy (p, message, sizeof (PinosMessageTransportUpdate));
break;
case PINOS_MESSAGE_INVALID:
return false;
}