2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
20 #ifndef _THRIFT_SERVER_TRANSPORT_H
21 #define _THRIFT_SERVER_TRANSPORT_H
23 #include <glib-object.h>
25 #include "thrift_transport.h"
29 /*! \file thrift_server_transport.h
30 * \brief Abstract class for Thrift server transports.
34 #define THRIFT_TYPE_SERVER_TRANSPORT (thrift_server_transport_get_type ())
35 #define THRIFT_SERVER_TRANSPORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THRIFT_TYPE_SERVER_TRANSPORT, ThriftServerTransport))
36 #define THRIFT_IS_SERVER_TRANSPORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THRIFT_TYPE_SERVER_TRANSPORT))
37 #define THRIFT_SERVER_TRANSPORT_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), THRIFT_TYPE_SERVER_TRANSPORT, ThriftServerTransportClass))
38 #define THRIFT_IS_SERVER_TRANSPORT_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), THRIFT_TYPE_SERVER_TRANSPORT))
39 #define THRIFT_SERVER_TRANSPORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THRIFT_TYPE_SERVER_TRANSPORT, ThriftServerTransportClass))
41 typedef struct _ThriftServerTransport ThriftServerTransport
;
43 struct _ThriftServerTransport
48 typedef struct _ThriftServerTransportClass ThriftServerTransportClass
;
51 * Thrift Transport class
53 struct _ThriftServerTransportClass
58 gboolean (*listen
) (ThriftServerTransport
*transport
, GError
**error
);
59 ThriftTransport
*(*accept
) (ThriftServerTransport
*transport
, GError
**error
);
60 gboolean (*close
) (ThriftServerTransport
*transport
, GError
**error
);
63 /* used by THRIFT_TYPE_SERVER_TRANSPORT */
64 GType
thrift_server_transport_get_type (void);
67 * Listen for new connections.
68 * \public \memberof ThriftServerTransportClass
70 gboolean
thrift_server_transport_listen (ThriftServerTransport
*transport
,
74 * Accept a connection.
75 * \public \memberof ThriftServerTransportClass
77 ThriftTransport
*thrift_server_transport_accept
78 (ThriftServerTransport
*transport
, GError
**error
);
81 * Close the transport.
82 * \public \memberof ThriftServerTransportClass
84 gboolean
thrift_server_transport_close (ThriftServerTransport
*transport
,
89 #endif /* _THRIFT_SERVER_TRANSPORT_H */