source: appstream-generator/build/girepo/gio/TcpConnection.d @ 4841

Last change on this file since 4841 was 4841, checked in by Juanma, 2 years ago

Initial release

File size: 2.9 KB
Line 
1/*
2 * Licensed under the GNU Lesser General Public License Version 3
3 *
4 * This library is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation, either version 3 of the license, or
7 * (at your option) any later version.
8 *
9 * This software is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this library.  If not, see <http://www.gnu.org/licenses/>.
16 */
17
18// generated automatically - do not change
19
20
21module gio.TcpConnection;
22
23private import gi.gio;
24public  import gi.giotypes;
25private import gio.SocketConnection;
26
27
28/**
29 * This is the subclass of #GSocketConnection that is created
30 * for TCP/IP sockets.
31 *
32 * Since: 2.22
33 */
34public class TcpConnection : SocketConnection
35{
36        /** the main Gtk struct */
37        protected GTcpConnection* gTcpConnection;
38
39        /** Get the main Gtk struct */
40        public GTcpConnection* getTcpConnectionStruct()
41        {
42                return gTcpConnection;
43        }
44
45        /** the main Gtk struct as a void* */
46        protected override void* getStruct()
47        {
48                return cast(void*)gTcpConnection;
49        }
50
51        protected override void setStruct(GObject* obj)
52        {
53                gTcpConnection = cast(GTcpConnection*)obj;
54                super.setStruct(obj);
55        }
56
57        /**
58         * Sets our main struct and passes it to the parent class.
59         */
60        public this (GTcpConnection* gTcpConnection, bool ownedRef = false)
61        {
62                this.gTcpConnection = gTcpConnection;
63                super(cast(GSocketConnection*)gTcpConnection, ownedRef);
64        }
65
66
67        /** */
68        public static GType getType()
69        {
70                return g_tcp_connection_get_type();
71        }
72
73        /**
74         * Checks if graceful disconnects are used. See
75         * g_tcp_connection_set_graceful_disconnect().
76         *
77         * Returns: %TRUE if graceful disconnect is used on close, %FALSE otherwise
78         *
79         * Since: 2.22
80         */
81        public bool getGracefulDisconnect()
82        {
83                return g_tcp_connection_get_graceful_disconnect(gTcpConnection) != 0;
84        }
85
86        /**
87         * This enables graceful disconnects on close. A graceful disconnect
88         * means that we signal the receiving end that the connection is terminated
89         * and wait for it to close the connection before closing the connection.
90         *
91         * A graceful disconnect means that we can be sure that we successfully sent
92         * all the outstanding data to the other end, or get an error reported.
93         * However, it also means we have to wait for all the data to reach the
94         * other side and for it to acknowledge this by closing the socket, which may
95         * take a while. For this reason it is disabled by default.
96         *
97         * Params:
98         *     gracefulDisconnect = Whether to do graceful disconnects or not
99         *
100         * Since: 2.22
101         */
102        public void setGracefulDisconnect(bool gracefulDisconnect)
103        {
104                g_tcp_connection_set_graceful_disconnect(gTcpConnection, gracefulDisconnect);
105        }
106}
Note: See TracBrowser for help on using the repository browser.