|
Packit Service |
ca3877 |
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
|
|
Packit Service |
ca3877 |
/*
|
|
Packit Service |
ca3877 |
* soup-websocket-connection.h: This file was originally part of Cockpit.
|
|
Packit Service |
ca3877 |
*
|
|
Packit Service |
ca3877 |
* Copyright 2013, 2014 Red Hat, Inc.
|
|
Packit Service |
ca3877 |
*
|
|
Packit Service |
ca3877 |
* Cockpit is free software; you can redistribute it and/or modify it
|
|
Packit Service |
ca3877 |
* under the terms of the GNU Lesser General Public License as published by
|
|
Packit Service |
ca3877 |
* the Free Software Foundation; either version 2.1 of the License, or
|
|
Packit Service |
ca3877 |
* (at your option) any later version.
|
|
Packit Service |
ca3877 |
*
|
|
Packit Service |
ca3877 |
* Cockpit is distributed in the hope that it will be useful, but
|
|
Packit Service |
ca3877 |
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
ca3877 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
ca3877 |
* Lesser General Public License for more details.
|
|
Packit Service |
ca3877 |
*
|
|
Packit Service |
ca3877 |
* You should have received a copy of the GNU Lesser General Public License
|
|
Packit Service |
ca3877 |
* along with this library; If not, see <http://www.gnu.org/licenses/>.
|
|
Packit Service |
ca3877 |
*/
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
#ifndef __SOUP_WEBSOCKET_CONNECTION_H__
|
|
Packit Service |
ca3877 |
#define __SOUP_WEBSOCKET_CONNECTION_H__
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
#include <libsoup/soup-types.h>
|
|
Packit Service |
ca3877 |
#include <libsoup/soup-websocket.h>
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
G_BEGIN_DECLS
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
#define SOUP_TYPE_WEBSOCKET_CONNECTION (soup_websocket_connection_get_type ())
|
|
Packit Service |
ca3877 |
#define SOUP_WEBSOCKET_CONNECTION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), SOUP_TYPE_WEBSOCKET_CONNECTION, SoupWebsocketConnection))
|
|
Packit Service |
ca3877 |
#define SOUP_IS_WEBSOCKET_CONNECTION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), SOUP_TYPE_WEBSOCKET_CONNECTION))
|
|
Packit Service |
ca3877 |
#define SOUP_WEBSOCKET_CONNECTION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), SOUP_TYPE_WEBSOCKET_CONNECTION, SoupWebsocketConnectionClass))
|
|
Packit Service |
ca3877 |
#define SOUP_WEBSOCKET_CONNECTION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), SOUP_TYPE_WEBSOCKET_CONNECTION, SoupWebsocketConnectionClass))
|
|
Packit Service |
ca3877 |
#define SOUP_IS_WEBSOCKET_CONNECTION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), SOUP_TYPE_WEBSOCKET_CONNECTION))
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
typedef struct _SoupWebsocketConnectionPrivate SoupWebsocketConnectionPrivate;
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
struct _SoupWebsocketConnection {
|
|
Packit Service |
ca3877 |
GObject parent;
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
/*< private >*/
|
|
Packit Service |
ca3877 |
SoupWebsocketConnectionPrivate *pv;
|
|
Packit Service |
ca3877 |
};
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
typedef struct {
|
|
Packit Service |
ca3877 |
GObjectClass parent;
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
/* signals */
|
|
Packit Service |
ca3877 |
void (* message) (SoupWebsocketConnection *self,
|
|
Packit Service |
ca3877 |
SoupWebsocketDataType type,
|
|
Packit Service |
ca3877 |
GBytes *message);
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
void (* error) (SoupWebsocketConnection *self,
|
|
Packit Service |
ca3877 |
GError *error);
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
void (* closing) (SoupWebsocketConnection *self);
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
void (* closed) (SoupWebsocketConnection *self);
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
void (* pong) (SoupWebsocketConnection *self,
|
|
Packit Service |
ca3877 |
GBytes *message);
|
|
Packit Service |
ca3877 |
} SoupWebsocketConnectionClass;
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
SOUP_AVAILABLE_IN_2_50
|
|
Packit Service |
ca3877 |
GType soup_websocket_connection_get_type (void) G_GNUC_CONST;
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
SOUP_AVAILABLE_IN_2_50
|
|
Packit Service |
ca3877 |
SoupWebsocketConnection *soup_websocket_connection_new (GIOStream *stream,
|
|
Packit Service |
ca3877 |
SoupURI *uri,
|
|
Packit Service |
ca3877 |
SoupWebsocketConnectionType type,
|
|
Packit Service |
ca3877 |
const char *origin,
|
|
Packit Service |
ca3877 |
const char *protocol);
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
SOUP_AVAILABLE_IN_2_50
|
|
Packit Service |
ca3877 |
GIOStream * soup_websocket_connection_get_io_stream (SoupWebsocketConnection *self);
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
SOUP_AVAILABLE_IN_2_50
|
|
Packit Service |
ca3877 |
SoupWebsocketConnectionType soup_websocket_connection_get_connection_type (SoupWebsocketConnection *self);
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
SOUP_AVAILABLE_IN_2_50
|
|
Packit Service |
ca3877 |
SoupURI * soup_websocket_connection_get_uri (SoupWebsocketConnection *self);
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
SOUP_AVAILABLE_IN_2_50
|
|
Packit Service |
ca3877 |
const char * soup_websocket_connection_get_origin (SoupWebsocketConnection *self);
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
SOUP_AVAILABLE_IN_2_50
|
|
Packit Service |
ca3877 |
const char * soup_websocket_connection_get_protocol (SoupWebsocketConnection *self);
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
SOUP_AVAILABLE_IN_2_50
|
|
Packit Service |
ca3877 |
SoupWebsocketState soup_websocket_connection_get_state (SoupWebsocketConnection *self);
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
SOUP_AVAILABLE_IN_2_50
|
|
Packit Service |
ca3877 |
gushort soup_websocket_connection_get_close_code (SoupWebsocketConnection *self);
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
SOUP_AVAILABLE_IN_2_50
|
|
Packit Service |
ca3877 |
const char * soup_websocket_connection_get_close_data (SoupWebsocketConnection *self);
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
SOUP_AVAILABLE_IN_2_50
|
|
Packit Service |
ca3877 |
void soup_websocket_connection_send_text (SoupWebsocketConnection *self,
|
|
Packit Service |
ca3877 |
const char *text);
|
|
Packit Service |
ca3877 |
SOUP_AVAILABLE_IN_2_50
|
|
Packit Service |
ca3877 |
void soup_websocket_connection_send_binary (SoupWebsocketConnection *self,
|
|
Packit Service |
ca3877 |
gconstpointer data,
|
|
Packit Service |
ca3877 |
gsize length);
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
SOUP_AVAILABLE_IN_2_50
|
|
Packit Service |
ca3877 |
void soup_websocket_connection_close (SoupWebsocketConnection *self,
|
|
Packit Service |
ca3877 |
gushort code,
|
|
Packit Service |
ca3877 |
const char *data);
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
SOUP_AVAILABLE_IN_2_56
|
|
Packit Service |
ca3877 |
guint64 soup_websocket_connection_get_max_incoming_payload_size (SoupWebsocketConnection *self);
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
SOUP_AVAILABLE_IN_2_56
|
|
Packit Service |
ca3877 |
void soup_websocket_connection_set_max_incoming_payload_size (SoupWebsocketConnection *self,
|
|
Packit Service |
ca3877 |
guint64 max_incoming_payload_size);
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
SOUP_AVAILABLE_IN_2_58
|
|
Packit Service |
ca3877 |
guint soup_websocket_connection_get_keepalive_interval (SoupWebsocketConnection *self);
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
SOUP_AVAILABLE_IN_2_58
|
|
Packit Service |
ca3877 |
void soup_websocket_connection_set_keepalive_interval (SoupWebsocketConnection *self,
|
|
Packit Service |
ca3877 |
guint interval);
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
G_END_DECLS
|
|
Packit Service |
ca3877 |
|
|
Packit Service |
ca3877 |
#endif /* __SOUP_WEBSOCKET_CONNECTION_H__ */
|