summaryrefslogtreecommitdiff
path: root/src/lib/ecore_con/ecore_con_base.eo
diff options
context:
space:
mode:
authorSrivardhan Hebbar <sri.hebbar@samsung.com>2016-02-17 16:57:29 -0800
committerCedric BAIL <cedric@osg.samsung.com>2016-02-18 11:25:21 -0800
commit865624dab0d66c404493bb9ddb2bb63c4e4f3ef1 (patch)
tree69bed88853020c5c5f34587fddc73fa6d7586b6a /src/lib/ecore_con/ecore_con_base.eo
parentec2f92e35f5a0836933d82b6b7f518a1d7550afc (diff)
ecore_con: changing from Ecore.Con.Base to Efl.Network.Base.
Summary: Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com> Reviewers: cedric Subscribers: jpeg Differential Revision: https://phab.enlightenment.org/D3696 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/lib/ecore_con/ecore_con_base.eo')
-rw-r--r--src/lib/ecore_con/ecore_con_base.eo210
1 files changed, 0 insertions, 210 deletions
diff --git a/src/lib/ecore_con/ecore_con_base.eo b/src/lib/ecore_con/ecore_con_base.eo
deleted file mode 100644
index bec25ee..0000000
--- a/src/lib/ecore_con/ecore_con_base.eo
+++ /dev/null
@@ -1,210 +0,0 @@
1type Ecore_Con_Dns_Cb: __undefined_type;
2
3enum Ecore.Con.Type
4{
5 [[Types for an ecore_con client/server object. A correct way to set this type is
6 with an ECORE_CON_$TYPE, optionally OR'ed with an ECORE_CON_$USE if encryption is desired,
7 and LOAD_CERT if the previously loaded certificate should be used.]]
8 legacy: ecore_con;
9
10 local_user = 0, [[Socket in "~/.ecore"]]
11 local_system = 1, [[Socket in /tmp]]
12 local_abstract = 2, [[Abstract socket]]
13 remote_tcp = 3, [[Remote server using TCP]]
14 remote_mcast = 4, [[Remote multicast server]]
15 remote_udp = 5, [[Remote server using UDP]]
16 remote_broadcasT = 6, [[Remote broadcast using UDP]]
17 remote_nodelay = 7, [[Remote connection sending packets immediately]]
18 remote_cork = 8, [[Remote connection sending data in large chunks
19 Note: Only available on Linux
20 @since 1.2]]
21 use_ssl2 = (1 << 4), [[Use SSL2: UNSUPPORTED.]]
22 use_ssl3 = (1 << 5), [[Use SSL3: UNSUPPORTED.]]
23 use_tls = (1 << 6), [[Use TLS]]
24 use_mixed = Ecore.Con.Type.use_tls | Ecore.Con.Type.use_ssl3, [[Use both TLS and SSL3]]
25 load_cert = (1 << 7), [[Attempt to use the loaded certificate]]
26 no_proxy = (1 << 8), [[Disable all types of proxy on the server
27 Note: Only functional for clients
28 @since 1.2]]
29 socket_activate = (1 << 9)
30}
31
32abstract Ecore.Con.Base (Eo.Base) {
33 legacy_prefix: ecore_con;
34 eo_prefix: ecore_con_obj;
35 data: null;
36 methods {
37 @property ip {
38 [[Control the IP address of a server that has been connected to.
39
40 The param is a pointer to an internal string that contains the IP
41 address of the connected server in the form "XXX.YYY.ZZZ.AAA" IP
42 notation. This string should not be modified or trusted to stay
43 valid after deletion for the svr object. If no IP is known
44 null is returned.
45 ]]
46 get {
47 legacy: null;
48 }
49 values {
50 ip: const(char)*; [[The IP address]]
51 }
52 }
53 @property uptime {
54 [[Check how long the object has been connected
55
56 This function is used to find out how long a client has been
57 connected for.
58 ]]
59 get {
60 legacy: null;
61 }
62 values {
63 uptime: double; [[The total time, in seconds, that the object has been connected.]]
64 }
65 }
66 @property port {
67 [[Return the port that the obj is connected to]]
68 set {
69 legacy: null;
70 }
71 get {
72 legacy: null;
73 }
74 values {
75 port: int; [[The The port that obj is connected to, or -1 on error.]]
76 }
77 }
78 @property fd {
79 [[Get the fd that the server is connected to
80
81 This function returns the fd which is used by the underlying server
82 connection. It should not be tampered with unless you REALLY know
83 what you are doing.
84
85 Note: This function is only valid for servers created with
86 \@ref ecore_con_server_connect.
87
88 Warning: Seriously. Don't use this unless you know what you are doing.
89
90 @since 1.1
91 ]]
92 get {
93 legacy: null;
94 }
95 values {
96 fd: int; [[The fd, or -1 on failure.]]
97 }
98 }
99 @property connected {
100 [[Returns whether the client is still connected]]
101 get {
102 legacy: null;
103 }
104 values {
105 connected: bool; [[Returns true if connected, false otherwise.]]
106 }
107 }
108 @property timeout {
109 [[Control the default time after which an inactive client will be
110 disconnected.
111
112 This function is used by the server to set the default idle timeout
113 on clients. If the any of the clients becomes idle for a time higher
114 than this value, it will be disconnected. A value of < 1 disables
115 the idle timeout.
116
117 This timeout is not affected by the one set by @.timeout.set. A
118 client will be disconnected whenever the client or the server
119 timeout is reached. That means, the lower timeout value will be
120 used for that client if @.timeout.set is used on it.
121 ]]
122 set {
123 legacy: null;
124 }
125 get {
126 legacy: null;
127 }
128 values {
129 timeout: double; [[The timeout, in seconds, to disconnect after.]]
130 }
131 }
132 flush {
133 [[Flushes all pending data to the given server.
134
135 This function will block until all data is sent to the server.
136 ]]
137 legacy: null;
138 }
139 send {
140 [[Sends the given data to the given server.
141
142 This function will send the given data to the server as soon as the
143 program is back to the main loop. Thus, this function returns
144 immediately (non-blocking). If the data needs to be sent now, call
145 \@ref ecore_con_server_flush after this one.
146 ]]
147 legacy: null;
148
149 params {
150 data: const(void)*; [[The given data]]
151 size: int; [[Length of the data, in bytes.]]
152 }
153 return: int; [[The number of bytes sent. 0 will be returned if there
154 is an error.]]
155 }
156 lookup @class {
157 [[Do an asynchronous DNS lookup.
158
159 This function performs a DNS lookup on the hostname specified by name,
160 then calls done_cb with the result and the data given as parameter.
161 The result will be given to the done_cb as follows:
162
163 canonname - the canonical name of the address, ip - the resolved ip
164 address, addr - a pointer to the socket address, addrlen - the length
165 of the socket address, in bytes, data - the data pointer given as
166 parameter.
167 ]]
168 params {
169 name: const(char)* @nonull; [[IP address or server name to translate.]]
170 done_cb: Ecore_Con_Dns_Cb; [[Callback to notify when done.]]
171 data: const(void)*; [[User data to be given to done_cb.]]
172 }
173 return: bool; [[true if the request did not fail to be set up, false otherwise.]]
174 }
175 }
176 implements {
177 @virtual .ip.get;
178 @virtual .uptime.get;
179 @virtual .port.set;
180 @virtual .port.get;
181 @virtual .fd.get;
182 @virtual .connected.get;
183 @virtual .timeout.set;
184 @virtual .timeout.get;
185 @virtual .flush;
186 @virtual .send;
187 }
188 events {
189 data,received: Ecore_Con_Event_Data_Received;
190 connection,upgraded;
191 connection,error: const(char) *;
192 }
193}
194
195/* FIXME: Should actually be a binbuf. */
196struct Ecore_Con_Event_Data_Received {
197 data: void *; [[The data thet got sent.]]
198 size: int; [[The length of the data sent.]]
199}
200
201/* TODO
202* Add events (to all of the ecore con stuff, e.g url).
203* Make server the father of the client - make sure I don't leak references.
204*
205* Still need to add constructor client, and most likely migrate ecore_con_eet.
206*
207* Split server to two classes, listener and connector (or w/e).
208*
209* Mark the constructing properties all around.
210*/