Home | History | Annotate | Download | only in android

Lines Matching refs:client

582 /* Descriptor for a data buffer pending to be sent to a qemud pipe client.
584 * When a service decides to send data to the client, there could be cases when
585 * client is not ready to read them. In this case there is no GoldfishPipeBuffer
587 * client descriptor, and "send" them over to the client in _qemudPipe_recvBuffers
588 * callback. Pending service data is stored in the client descriptor as a list
600 /* Links next message in the client. */
605 /* A QemudClient models a single client as seen by the emulator.
606 * Each client has its own channel id (for the serial qemud), or pipe descriptor
612 * that are unique for each client.
616 /* Defines type of the client: pipe, or serial.
619 /* Client is communicating via pipe. */
621 /* Client is communicating via serial port. */
627 * Every time a client connects to the QEMUD via pipe, an instance of this
628 * structure is created to represent a connection used by new pipe client.
637 /* Client for this pipe. */
638 QemudClient* client;
642 /* Defines protocol, used by the client. */
681 _is_pipe_client(QemudClient* client)
683 return (client-> protocol == QEMUD_PROTOCOL_PIPE) ? true : false;
687 QemudClient* client );
712 /* receive a new message from a client, and dispatch it to
786 /* Technically, calling 'clie_recv' can destroy client object 'c'
796 /* Sends data to a pipe-based client.
799 _qemud_pipe_send(QemudClient* client, const uint8_t* msg, int msglen);
801 /* Frees memory allocated for the qemud client.
823 /* disconnect a client. this automatically frees the QemudClient.
824 * note that this also removes the client from the global list
845 /* We must NULL the client reference in the QemuPipe for this connection,
846 * so if a sudden receive request comes after client has been closed, we
848 c->ProtocolSelector.Pipe.qemud_pipe->client = NULL;
856 /* call the client close callback */
874 * Since channel_id < 0 is an invalid value for a serial client, it would
875 * indicate that creating client is a pipe client. */
892 /* Allocating a pipe client. */
897 /* Allocating a serial client. */
929 /* Saves the client state needed to re-establish connections on load.
941 /* save client-specific state */
958 /* Loads client state from file, then starts a new client connected to the
990 D("%s: illegal snapshot: client for control channel must no be saved\n",
995 /* re-connect client */
1000 /* load client-specific state */
1123 D("%s: could not find client for service '%s'",
1138 * the client to the service's list automatically.
1140 * returns the client or NULL if an error occurred
1147 QemudClient* client =
1149 if (client == NULL) {
1154 D("%s: registered client channel %d for '%s' service",
1156 return client;
1297 /* dispatch to an existing client if possible
1329 /* check service's client count */
1336 /* connect a new client to the service on the given channel */
1343 /* disconnect a given client from its channel id */
1350 /* find the client by its channel id, then disconnect it */
1353 D("%s: disconnecting client %d",
1355 /* note thatt this removes the client from
1384 D("%s: disconnecting client %d",
1386 D("%s: disconnecting client %d\n",
1405 QemudClient* client )
1412 * the client message must be "connect:<service-name>:<id>"
1455 /* handle client disconnections,
1456 * this message arrives when the client has closed the connection.
1563 * a new client connection.
1566 * send incoming client messages to the corresponding service
1567 * implementation, or notify the service that a client has
1595 /* Caches a service message into the client's descriptor.
1600 _qemud_pipe_cache_buffer(QemudClient* client, const uint8_t* msg, int msglen)
1603 QemudPipeMessage** ins_at = &client->ProtocolSelector.Pipe.messages;
1619 goldfish_pipe_wake(client->ProtocolSelector.Pipe.qemud_pipe->hwpipe,
1624 /* Sends service message to the client.
1627 _qemud_pipe_send(QemudClient* client, const uint8_t* msg, int msglen)
1631 int framing = client->framing;
1654 _qemud_pipe_cache_buffer(client, frame, FRAME_HEADER_SIZE);
1662 _qemud_pipe_cache_buffer(client, msg, avail);
1669 * or message to a specific client.
1672 qemud_client_send ( QemudClient* client, const uint8_t* msg, int msglen )
1674 if (_is_pipe_client(client)) {
1675 _qemud_pipe_send(client, msg, msglen);
1677 qemud_serial_send(client->ProtocolSelector.Serial.serial,
1678 client->ProtocolSelector.Serial.channel,
1679 client->framing != 0, msg, msglen);
1683 /* enable framing for this client. When TRUE, this will
1688 qemud_client_set_framing( QemudClient* client, int framing )
1691 if (client->framing) {
1692 if (!client->need_header) {
1693 AFREE(client->payload->buff);
1694 client->need_header = 1;
1697 client->framing = !!framing;
1701 * specific client connection.
1704 qemud_client_close( QemudClient* client )
1706 qemud_client_disconnect(client);
1743 * which spares us dealing with the exception of a client not connected to a
1759 /* save client channels */
1763 /* skip control channel client */
1844 * Here we will create a new client as well as pipe descriptor representing new
1852 QemudClient* client;
1865 /* 'args' contain service name, and optional parameters for the client that
1867 * service name wit ':'. Separate service name from the client param. */
1891 /* Create a client for this connection. -1 as a channel ID signals that this
1892 * is a pipe client. */
1893 client = qemud_service_connect_client(sv, -1, client_args);
1894 if (client != NULL) {
1899 pipe->client = client;
1900 client->ProtocolSelector.Pipe.qemud_pipe = pipe;
1912 QemudClient* client = pipe->client;
1914 if (client != NULL) {
1915 qemud_client_disconnect(client);
1917 D("%s: Unexpected NULL client", __FUNCTION__);
1921 /* Called when the guest has sent some data to the client.
1929 QemudClient* client = pipe->client;
1932 if (client == NULL) {
1933 D("%s: Unexpected NULL client", __FUNCTION__);
1940 qemud_client_recv(client, buffers->data, buffers->size);
1944 * before calling the high level client. */
1957 qemud_client_recv(client, msg, transferred);
1964 /* Called when the guest is reading data from the client.
1970 QemudClient* client = pipe->client;
1977 if (client == NULL) {
1978 D("%s: Unexpected NULL client", __FUNCTION__);
1982 msg_list = &client->ProtocolSelector.Pipe.messages;
1985 * PIPE_WAKE_READ when service sends data to the client. */
1990 * messages in the client's message list. */
2021 QemudClient* client = pipe->client;
2024 if (client != NULL) {
2026 if (client->ProtocolSelector.Pipe.messages != NULL) {
2030 D("%s: Unexpected NULL client", __FUNCTION__);
2119 * which will be called whenever a new client tries to connect
2175 * QemudClient that connects a qemud client running in the emulated
2183 * A QemudCharService can have only one client by definition.
2193 /* called whenever a new message arrives from a qemud client.
2198 QemudClient* client )
2212 QemudClient* client = opaque;
2216 * So, when guest disconnects from the qemu pipe, and emulator-side client
2220 * due to guest disconnection. As long as the client was a qemu pipe - based
2221 * client, it's fine, since we don't really need to do anything in this case.
2223 if (!_is_pipe_client(client)) {
2239 /* called to read data from the charpipe and send it to the client.
2240 * used qemud_service_broadcast() even if there is a single client
2250 /* called when a qemud client tries to connect to a char. service.
2251 * we simply create a new client and open the charpipe to receive