2013-12-29 04:53:12 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2013 Glyptodon LLC
|
2011-11-23 08:01:27 +00:00
|
|
|
*
|
2013-12-29 04:53:12 +00:00
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
|
|
* in the Software without restriction, including without limitation the rights
|
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
2011-11-23 08:01:27 +00:00
|
|
|
*
|
2013-12-29 04:53:12 +00:00
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
2011-11-23 08:01:27 +00:00
|
|
|
*
|
2013-12-29 04:53:12 +00:00
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
* THE SOFTWARE.
|
|
|
|
*/
|
2011-11-23 08:01:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
#ifndef _GUACD_CLIENT_H
|
|
|
|
#define _GUACD_CLIENT_H
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The time to allow between sync responses in milliseconds. If a sync
|
|
|
|
* instruction is sent to the client and no response is received within this
|
|
|
|
* timeframe, server messages will not be handled until a sync instruction is
|
|
|
|
* received from the client.
|
|
|
|
*/
|
2011-11-30 20:03:27 +00:00
|
|
|
#define GUACD_SYNC_THRESHOLD 500
|
2011-11-23 08:01:27 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The time to allow between server sync messages in milliseconds. A sync
|
2011-11-30 20:03:27 +00:00
|
|
|
* message from the server will be sent every GUACD_SYNC_FREQUENCY milliseconds.
|
2011-11-23 08:01:27 +00:00
|
|
|
* As this will induce a response from a client that is not malfunctioning,
|
|
|
|
* this is used to detect when a client has died. This must be set to a
|
|
|
|
* reasonable value to avoid clients being disconnected unnecessarily due
|
|
|
|
* to timeout.
|
|
|
|
*/
|
2011-11-30 20:03:27 +00:00
|
|
|
#define GUACD_SYNC_FREQUENCY 5000
|
2011-11-23 08:01:27 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The amount of time to wait after handling server messages. If a client
|
|
|
|
* plugin has a message handler, and sends instructions when server messages
|
|
|
|
* are being handled, there will be a pause of this many milliseconds before
|
|
|
|
* the next call to the message handler.
|
|
|
|
*/
|
2011-11-30 20:03:27 +00:00
|
|
|
#define GUACD_MESSAGE_HANDLE_FREQUENCY 50
|
|
|
|
|
2011-11-23 08:01:27 +00:00
|
|
|
/**
|
|
|
|
* The number of milliseconds to wait for messages in any phase before
|
|
|
|
* timing out and closing the connection with an error.
|
|
|
|
*/
|
2011-11-30 20:03:27 +00:00
|
|
|
#define GUACD_TIMEOUT 15000
|
2011-11-23 08:01:27 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The number of microseconds to wait for messages in any phase before
|
|
|
|
* timing out and closing the conncetion with an error. This is always
|
2011-11-30 20:03:27 +00:00
|
|
|
* equal to GUACD_TIMEOUT * 1000.
|
2011-11-23 08:01:27 +00:00
|
|
|
*/
|
2011-11-30 20:03:27 +00:00
|
|
|
#define GUACD_USEC_TIMEOUT (GUACD_TIMEOUT*1000)
|
2011-11-23 08:01:27 +00:00
|
|
|
|
2011-12-06 08:41:08 +00:00
|
|
|
int guacd_client_start(guac_client* client);
|
2011-11-23 08:01:27 +00:00
|
|
|
|
|
|
|
#endif
|