PageRenderTime 63ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/docs/reference/gio/html/GSocketClient.html

https://gitlab.com/ImageMagick/glib
HTML | 2070 lines | 2068 code | 2 blank | 0 comment | 0 complexity | a0ba2450f919f8b86a3136f1c823e639 MD5 | raw file
Possible License(s): LGPL-2.1, AGPL-3.0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <title>GSocketClient: GIO Reference Manual</title>
  6. <meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
  7. <link rel="home" href="index.html" title="GIO Reference Manual">
  8. <link rel="up" href="highlevel-socket.html" title="High-level network functionallity">
  9. <link rel="prev" href="highlevel-socket.html" title="High-level network functionallity">
  10. <link rel="next" href="GSocketConnection.html" title="GSocketConnection">
  11. <meta name="generator" content="GTK-Doc V1.25.1 (XML mode)">
  12. <link rel="stylesheet" href="style.css" type="text/css">
  13. </head>
  14. <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
  15. <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
  16. <td width="100%" align="left" class="shortcuts">
  17. <a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
  18. <a href="#GSocketClient.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span> 
  19. <a href="#GSocketClient.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_properties">  <span class="dim">|</span> 
  20. <a href="#GSocketClient.properties" class="shortcut">Properties</a></span><span id="nav_signals">  <span class="dim">|</span> 
  21. <a href="#GSocketClient.signals" class="shortcut">Signals</a></span>
  22. </td>
  23. <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
  24. <td><a accesskey="u" href="highlevel-socket.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
  25. <td><a accesskey="p" href="highlevel-socket.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
  26. <td><a accesskey="n" href="GSocketConnection.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
  27. </tr></table>
  28. <div class="refentry">
  29. <a name="GSocketClient"></a><div class="titlepage"></div>
  30. <div class="refnamediv"><table width="100%"><tr>
  31. <td valign="top">
  32. <h2><span class="refentrytitle"><a name="GSocketClient.top_of_page"></a>GSocketClient</span></h2>
  33. <p>GSocketClient Helper for connecting to a network service</p>
  34. </td>
  35. <td class="gallery_image" valign="top" align="right"></td>
  36. </tr></table></div>
  37. <div class="refsect1">
  38. <a name="GSocketClient.functions"></a><h2>Functions</h2>
  39. <div class="informaltable"><table class="informaltable" width="100%" border="0">
  40. <colgroup>
  41. <col width="150px" class="functions_return">
  42. <col class="functions_name">
  43. </colgroup>
  44. <tbody>
  45. <tr>
  46. <td class="function_type">
  47. <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="returnvalue">GSocketClient</span></a> *
  48. </td>
  49. <td class="function_name">
  50. <a class="link" href="GSocketClient.html#g-socket-client-new" title="g_socket_client_new ()">g_socket_client_new</a> <span class="c_punctuation">()</span>
  51. </td>
  52. </tr>
  53. <tr>
  54. <td class="function_type">
  55. <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="returnvalue">GSocketConnection</span></a> *
  56. </td>
  57. <td class="function_name">
  58. <a class="link" href="GSocketClient.html#g-socket-client-connect" title="g_socket_client_connect ()">g_socket_client_connect</a> <span class="c_punctuation">()</span>
  59. </td>
  60. </tr>
  61. <tr>
  62. <td class="function_type">
  63. <span class="returnvalue">void</span>
  64. </td>
  65. <td class="function_name">
  66. <a class="link" href="GSocketClient.html#g-socket-client-connect-async" title="g_socket_client_connect_async ()">g_socket_client_connect_async</a> <span class="c_punctuation">()</span>
  67. </td>
  68. </tr>
  69. <tr>
  70. <td class="function_type">
  71. <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="returnvalue">GSocketConnection</span></a> *
  72. </td>
  73. <td class="function_name">
  74. <a class="link" href="GSocketClient.html#g-socket-client-connect-finish" title="g_socket_client_connect_finish ()">g_socket_client_connect_finish</a> <span class="c_punctuation">()</span>
  75. </td>
  76. </tr>
  77. <tr>
  78. <td class="function_type">
  79. <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="returnvalue">GSocketConnection</span></a> *
  80. </td>
  81. <td class="function_name">
  82. <a class="link" href="GSocketClient.html#g-socket-client-connect-to-host" title="g_socket_client_connect_to_host ()">g_socket_client_connect_to_host</a> <span class="c_punctuation">()</span>
  83. </td>
  84. </tr>
  85. <tr>
  86. <td class="function_type">
  87. <span class="returnvalue">void</span>
  88. </td>
  89. <td class="function_name">
  90. <a class="link" href="GSocketClient.html#g-socket-client-connect-to-host-async" title="g_socket_client_connect_to_host_async ()">g_socket_client_connect_to_host_async</a> <span class="c_punctuation">()</span>
  91. </td>
  92. </tr>
  93. <tr>
  94. <td class="function_type">
  95. <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="returnvalue">GSocketConnection</span></a> *
  96. </td>
  97. <td class="function_name">
  98. <a class="link" href="GSocketClient.html#g-socket-client-connect-to-host-finish" title="g_socket_client_connect_to_host_finish ()">g_socket_client_connect_to_host_finish</a> <span class="c_punctuation">()</span>
  99. </td>
  100. </tr>
  101. <tr>
  102. <td class="function_type">
  103. <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="returnvalue">GSocketConnection</span></a> *
  104. </td>
  105. <td class="function_name">
  106. <a class="link" href="GSocketClient.html#g-socket-client-connect-to-service" title="g_socket_client_connect_to_service ()">g_socket_client_connect_to_service</a> <span class="c_punctuation">()</span>
  107. </td>
  108. </tr>
  109. <tr>
  110. <td class="function_type">
  111. <span class="returnvalue">void</span>
  112. </td>
  113. <td class="function_name">
  114. <a class="link" href="GSocketClient.html#g-socket-client-connect-to-service-async" title="g_socket_client_connect_to_service_async ()">g_socket_client_connect_to_service_async</a> <span class="c_punctuation">()</span>
  115. </td>
  116. </tr>
  117. <tr>
  118. <td class="function_type">
  119. <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="returnvalue">GSocketConnection</span></a> *
  120. </td>
  121. <td class="function_name">
  122. <a class="link" href="GSocketClient.html#g-socket-client-connect-to-service-finish" title="g_socket_client_connect_to_service_finish ()">g_socket_client_connect_to_service_finish</a> <span class="c_punctuation">()</span>
  123. </td>
  124. </tr>
  125. <tr>
  126. <td class="function_type">
  127. <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="returnvalue">GSocketConnection</span></a> *
  128. </td>
  129. <td class="function_name">
  130. <a class="link" href="GSocketClient.html#g-socket-client-connect-to-uri" title="g_socket_client_connect_to_uri ()">g_socket_client_connect_to_uri</a> <span class="c_punctuation">()</span>
  131. </td>
  132. </tr>
  133. <tr>
  134. <td class="function_type">
  135. <span class="returnvalue">void</span>
  136. </td>
  137. <td class="function_name">
  138. <a class="link" href="GSocketClient.html#g-socket-client-connect-to-uri-async" title="g_socket_client_connect_to_uri_async ()">g_socket_client_connect_to_uri_async</a> <span class="c_punctuation">()</span>
  139. </td>
  140. </tr>
  141. <tr>
  142. <td class="function_type">
  143. <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="returnvalue">GSocketConnection</span></a> *
  144. </td>
  145. <td class="function_name">
  146. <a class="link" href="GSocketClient.html#g-socket-client-connect-to-uri-finish" title="g_socket_client_connect_to_uri_finish ()">g_socket_client_connect_to_uri_finish</a> <span class="c_punctuation">()</span>
  147. </td>
  148. </tr>
  149. <tr>
  150. <td class="function_type">
  151. <span class="returnvalue">void</span>
  152. </td>
  153. <td class="function_name">
  154. <a class="link" href="GSocketClient.html#g-socket-client-set-family" title="g_socket_client_set_family ()">g_socket_client_set_family</a> <span class="c_punctuation">()</span>
  155. </td>
  156. </tr>
  157. <tr>
  158. <td class="function_type">
  159. <span class="returnvalue">void</span>
  160. </td>
  161. <td class="function_name">
  162. <a class="link" href="GSocketClient.html#g-socket-client-set-local-address" title="g_socket_client_set_local_address ()">g_socket_client_set_local_address</a> <span class="c_punctuation">()</span>
  163. </td>
  164. </tr>
  165. <tr>
  166. <td class="function_type">
  167. <span class="returnvalue">void</span>
  168. </td>
  169. <td class="function_name">
  170. <a class="link" href="GSocketClient.html#g-socket-client-set-protocol" title="g_socket_client_set_protocol ()">g_socket_client_set_protocol</a> <span class="c_punctuation">()</span>
  171. </td>
  172. </tr>
  173. <tr>
  174. <td class="function_type">
  175. <span class="returnvalue">void</span>
  176. </td>
  177. <td class="function_name">
  178. <a class="link" href="GSocketClient.html#g-socket-client-set-socket-type" title="g_socket_client_set_socket_type ()">g_socket_client_set_socket_type</a> <span class="c_punctuation">()</span>
  179. </td>
  180. </tr>
  181. <tr>
  182. <td class="function_type">
  183. <span class="returnvalue">void</span>
  184. </td>
  185. <td class="function_name">
  186. <a class="link" href="GSocketClient.html#g-socket-client-set-timeout" title="g_socket_client_set_timeout ()">g_socket_client_set_timeout</a> <span class="c_punctuation">()</span>
  187. </td>
  188. </tr>
  189. <tr>
  190. <td class="function_type">
  191. <span class="returnvalue">void</span>
  192. </td>
  193. <td class="function_name">
  194. <a class="link" href="GSocketClient.html#g-socket-client-set-enable-proxy" title="g_socket_client_set_enable_proxy ()">g_socket_client_set_enable_proxy</a> <span class="c_punctuation">()</span>
  195. </td>
  196. </tr>
  197. <tr>
  198. <td class="function_type">
  199. <span class="returnvalue">void</span>
  200. </td>
  201. <td class="function_name">
  202. <a class="link" href="GSocketClient.html#g-socket-client-set-proxy-resolver" title="g_socket_client_set_proxy_resolver ()">g_socket_client_set_proxy_resolver</a> <span class="c_punctuation">()</span>
  203. </td>
  204. </tr>
  205. <tr>
  206. <td class="function_type">
  207. <span class="returnvalue">void</span>
  208. </td>
  209. <td class="function_name">
  210. <a class="link" href="GSocketClient.html#g-socket-client-set-tls" title="g_socket_client_set_tls ()">g_socket_client_set_tls</a> <span class="c_punctuation">()</span>
  211. </td>
  212. </tr>
  213. <tr>
  214. <td class="function_type">
  215. <span class="returnvalue">void</span>
  216. </td>
  217. <td class="function_name">
  218. <a class="link" href="GSocketClient.html#g-socket-client-set-tls-validation-flags" title="g_socket_client_set_tls_validation_flags ()">g_socket_client_set_tls_validation_flags</a> <span class="c_punctuation">()</span>
  219. </td>
  220. </tr>
  221. <tr>
  222. <td class="function_type">
  223. <a class="link" href="GSocketAddress.html#GSocketFamily" title="enum GSocketFamily"><span class="returnvalue">GSocketFamily</span></a>
  224. </td>
  225. <td class="function_name">
  226. <a class="link" href="GSocketClient.html#g-socket-client-get-family" title="g_socket_client_get_family ()">g_socket_client_get_family</a> <span class="c_punctuation">()</span>
  227. </td>
  228. </tr>
  229. <tr>
  230. <td class="function_type">
  231. <a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="returnvalue">GSocketAddress</span></a> *
  232. </td>
  233. <td class="function_name">
  234. <a class="link" href="GSocketClient.html#g-socket-client-get-local-address" title="g_socket_client_get_local_address ()">g_socket_client_get_local_address</a> <span class="c_punctuation">()</span>
  235. </td>
  236. </tr>
  237. <tr>
  238. <td class="function_type">
  239. <a class="link" href="GSocket.html#GSocketProtocol" title="enum GSocketProtocol"><span class="returnvalue">GSocketProtocol</span></a>
  240. </td>
  241. <td class="function_name">
  242. <a class="link" href="GSocketClient.html#g-socket-client-get-protocol" title="g_socket_client_get_protocol ()">g_socket_client_get_protocol</a> <span class="c_punctuation">()</span>
  243. </td>
  244. </tr>
  245. <tr>
  246. <td class="function_type">
  247. <a class="link" href="GSocket.html#GSocketType" title="enum GSocketType"><span class="returnvalue">GSocketType</span></a>
  248. </td>
  249. <td class="function_name">
  250. <a class="link" href="GSocketClient.html#g-socket-client-get-socket-type" title="g_socket_client_get_socket_type ()">g_socket_client_get_socket_type</a> <span class="c_punctuation">()</span>
  251. </td>
  252. </tr>
  253. <tr>
  254. <td class="function_type">
  255. <a href="../glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>
  256. </td>
  257. <td class="function_name">
  258. <a class="link" href="GSocketClient.html#g-socket-client-get-timeout" title="g_socket_client_get_timeout ()">g_socket_client_get_timeout</a> <span class="c_punctuation">()</span>
  259. </td>
  260. </tr>
  261. <tr>
  262. <td class="function_type">
  263. <a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
  264. </td>
  265. <td class="function_name">
  266. <a class="link" href="GSocketClient.html#g-socket-client-get-enable-proxy" title="g_socket_client_get_enable_proxy ()">g_socket_client_get_enable_proxy</a> <span class="c_punctuation">()</span>
  267. </td>
  268. </tr>
  269. <tr>
  270. <td class="function_type">
  271. <a class="link" href="GProxyResolver.html" title="GProxyResolver"><span class="returnvalue">GProxyResolver</span></a> *
  272. </td>
  273. <td class="function_name">
  274. <a class="link" href="GSocketClient.html#g-socket-client-get-proxy-resolver" title="g_socket_client_get_proxy_resolver ()">g_socket_client_get_proxy_resolver</a> <span class="c_punctuation">()</span>
  275. </td>
  276. </tr>
  277. <tr>
  278. <td class="function_type">
  279. <a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
  280. </td>
  281. <td class="function_name">
  282. <a class="link" href="GSocketClient.html#g-socket-client-get-tls" title="g_socket_client_get_tls ()">g_socket_client_get_tls</a> <span class="c_punctuation">()</span>
  283. </td>
  284. </tr>
  285. <tr>
  286. <td class="function_type">
  287. <a class="link" href="gio-TLS-Overview.html#GTlsCertificateFlags" title="enum GTlsCertificateFlags"><span class="returnvalue">GTlsCertificateFlags</span></a>
  288. </td>
  289. <td class="function_name">
  290. <a class="link" href="GSocketClient.html#g-socket-client-get-tls-validation-flags" title="g_socket_client_get_tls_validation_flags ()">g_socket_client_get_tls_validation_flags</a> <span class="c_punctuation">()</span>
  291. </td>
  292. </tr>
  293. <tr>
  294. <td class="function_type">
  295. <span class="returnvalue">void</span>
  296. </td>
  297. <td class="function_name">
  298. <a class="link" href="GSocketClient.html#g-socket-client-add-application-proxy" title="g_socket_client_add_application_proxy ()">g_socket_client_add_application_proxy</a> <span class="c_punctuation">()</span>
  299. </td>
  300. </tr>
  301. </tbody>
  302. </table></div>
  303. </div>
  304. <div class="refsect1">
  305. <a name="GSocketClient.properties"></a><h2>Properties</h2>
  306. <div class="informaltable"><table class="informaltable" border="0">
  307. <colgroup>
  308. <col width="150px" class="properties_type">
  309. <col width="300px" class="properties_name">
  310. <col width="200px" class="properties_flags">
  311. </colgroup>
  312. <tbody>
  313. <tr>
  314. <td class="property_type"><a href="../glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td>
  315. <td class="property_name"><a class="link" href="GSocketClient.html#GSocketClient--enable-proxy" title="The “enable-proxy” property">enable-proxy</a></td>
  316. <td class="property_flags">Read / Write / Construct</td>
  317. </tr>
  318. <tr>
  319. <td class="property_type"><a class="link" href="GSocketAddress.html#GSocketFamily" title="enum GSocketFamily"><span class="type">GSocketFamily</span></a></td>
  320. <td class="property_name"><a class="link" href="GSocketClient.html#GSocketClient--family" title="The “family” property">family</a></td>
  321. <td class="property_flags">Read / Write / Construct</td>
  322. </tr>
  323. <tr>
  324. <td class="property_type">
  325. <a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="type">GSocketAddress</span></a> *</td>
  326. <td class="property_name"><a class="link" href="GSocketClient.html#GSocketClient--local-address" title="The “local-address” property">local-address</a></td>
  327. <td class="property_flags">Read / Write / Construct</td>
  328. </tr>
  329. <tr>
  330. <td class="property_type"><a class="link" href="GSocket.html#GSocketProtocol" title="enum GSocketProtocol"><span class="type">GSocketProtocol</span></a></td>
  331. <td class="property_name"><a class="link" href="GSocketClient.html#GSocketClient--protocol" title="The “protocol” property">protocol</a></td>
  332. <td class="property_flags">Read / Write / Construct</td>
  333. </tr>
  334. <tr>
  335. <td class="property_type">
  336. <a class="link" href="GProxyResolver.html" title="GProxyResolver"><span class="type">GProxyResolver</span></a> *</td>
  337. <td class="property_name"><a class="link" href="GSocketClient.html#GSocketClient--proxy-resolver" title="The “proxy-resolver” property">proxy-resolver</a></td>
  338. <td class="property_flags">Read / Write / Construct</td>
  339. </tr>
  340. <tr>
  341. <td class="property_type"><a href="../glib-Basic-Types.html#guint"><span class="type">guint</span></a></td>
  342. <td class="property_name"><a class="link" href="GSocketClient.html#GSocketClient--timeout" title="The “timeout” property">timeout</a></td>
  343. <td class="property_flags">Read / Write / Construct</td>
  344. </tr>
  345. <tr>
  346. <td class="property_type"><a href="../glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td>
  347. <td class="property_name"><a class="link" href="GSocketClient.html#GSocketClient--tls" title="The “tls” property">tls</a></td>
  348. <td class="property_flags">Read / Write / Construct</td>
  349. </tr>
  350. <tr>
  351. <td class="property_type"><a class="link" href="gio-TLS-Overview.html#GTlsCertificateFlags" title="enum GTlsCertificateFlags"><span class="type">GTlsCertificateFlags</span></a></td>
  352. <td class="property_name"><a class="link" href="GSocketClient.html#GSocketClient--tls-validation-flags" title="The “tls-validation-flags” property">tls-validation-flags</a></td>
  353. <td class="property_flags">Read / Write / Construct</td>
  354. </tr>
  355. <tr>
  356. <td class="property_type"><a class="link" href="GSocket.html#GSocketType" title="enum GSocketType"><span class="type">GSocketType</span></a></td>
  357. <td class="property_name"><a class="link" href="GSocketClient.html#GSocketClient--type" title="The “type” property">type</a></td>
  358. <td class="property_flags">Read / Write / Construct</td>
  359. </tr>
  360. </tbody>
  361. </table></div>
  362. </div>
  363. <div class="refsect1">
  364. <a name="GSocketClient.signals"></a><h2>Signals</h2>
  365. <div class="informaltable"><table class="informaltable" border="0">
  366. <colgroup>
  367. <col width="150px" class="signals_return">
  368. <col width="300px" class="signals_name">
  369. <col width="200px" class="signals_flags">
  370. </colgroup>
  371. <tbody><tr>
  372. <td class="signal_type"><span class="returnvalue">void</span></td>
  373. <td class="signal_name"><a class="link" href="GSocketClient.html#GSocketClient-event" title="The “event” signal">event</a></td>
  374. <td class="signal_flags"><a href="../gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS">Run Last</a></td>
  375. </tr></tbody>
  376. </table></div>
  377. </div>
  378. <div class="refsect1">
  379. <a name="GSocketClient.other"></a><h2>Types and Values</h2>
  380. <div class="informaltable"><table class="informaltable" width="100%" border="0">
  381. <colgroup>
  382. <col width="150px" class="name">
  383. <col class="description">
  384. </colgroup>
  385. <tbody>
  386. <tr>
  387. <td class="datatype_keyword"> </td>
  388. <td class="function_name"><a class="link" href="GSocketClient.html#GSocketClient-struct" title="GSocketClient">GSocketClient</a></td>
  389. </tr>
  390. <tr>
  391. <td class="datatype_keyword">enum</td>
  392. <td class="function_name"><a class="link" href="GSocketClient.html#GSocketClientEvent" title="enum GSocketClientEvent">GSocketClientEvent</a></td>
  393. </tr>
  394. </tbody>
  395. </table></div>
  396. </div>
  397. <div class="refsect1">
  398. <a name="GSocketClient.object-hierarchy"></a><h2>Object Hierarchy</h2>
  399. <pre class="screen"> <a href="../gobject-The-Base-Object-Type.html#GObject-struct">GObject</a>
  400. <span class="lineart"></span> GSocketClient
  401. </pre>
  402. </div>
  403. <div class="refsect1">
  404. <a name="GSocketClient.includes"></a><h2>Includes</h2>
  405. <pre class="synopsis">#include &lt;gio/gio.h&gt;
  406. </pre>
  407. </div>
  408. <div class="refsect1">
  409. <a name="GSocketClient.description"></a><h2>Description</h2>
  410. <p><a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> is a lightweight high-level utility class for connecting to
  411. a network host using a connection oriented socket type.</p>
  412. <p>You create a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> object, set any options you want, and then
  413. call a sync or async connect operation, which returns a <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a>
  414. subclass on success.</p>
  415. <p>The type of the <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a> object returned depends on the type of
  416. the underlying socket that is in use. For instance, for a TCP/IP connection
  417. it will be a <a class="link" href="GTcpConnection.html" title="GTcpConnection"><span class="type">GTcpConnection</span></a>.</p>
  418. <p>As <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> is a lightweight object, you don't need to cache it. You
  419. can just create a new one any time you need one.</p>
  420. </div>
  421. <div class="refsect1">
  422. <a name="GSocketClient.functions_details"></a><h2>Functions</h2>
  423. <div class="refsect2">
  424. <a name="g-socket-client-new"></a><h3>g_socket_client_new ()</h3>
  425. <pre class="programlisting"><a class="link" href="GSocketClient.html" title="GSocketClient"><span class="returnvalue">GSocketClient</span></a> *
  426. g_socket_client_new (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
  427. <p>Creates a new <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> with the default options.</p>
  428. <div class="refsect3">
  429. <a name="g-socket-client-new.returns"></a><h4>Returns</h4>
  430. <p> a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>.
  431. Free the returned object with <a href="../gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>.</p>
  432. </div>
  433. <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p>
  434. </div>
  435. <hr>
  436. <div class="refsect2">
  437. <a name="g-socket-client-connect"></a><h3>g_socket_client_connect ()</h3>
  438. <pre class="programlisting"><a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="returnvalue">GSocketConnection</span></a> *
  439. g_socket_client_connect (<em class="parameter"><code><a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> *client</code></em>,
  440. <em class="parameter"><code><a class="link" href="GSocketConnectable.html" title="GSocketConnectable"><span class="type">GSocketConnectable</span></a> *connectable</code></em>,
  441. <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
  442. <em class="parameter"><code><a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
  443. <p>Tries to resolve the <em class="parameter"><code>connectable</code></em>
  444. and make a network connection to it.</p>
  445. <p>Upon a successful connection, a new <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a> is constructed
  446. and returned. The caller owns this new object and must drop their
  447. reference to it when finished with it.</p>
  448. <p>The type of the <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a> object returned depends on the type of
  449. the underlying socket that is used. For instance, for a TCP/IP connection
  450. it will be a <a class="link" href="GTcpConnection.html" title="GTcpConnection"><span class="type">GTcpConnection</span></a>.</p>
  451. <p>The socket created will be the same family as the address that the
  452. <em class="parameter"><code>connectable</code></em>
  453. resolves to, unless family is set with <a class="link" href="GSocketClient.html#g-socket-client-set-family" title="g_socket_client_set_family ()"><code class="function">g_socket_client_set_family()</code></a>
  454. or indirectly via <a class="link" href="GSocketClient.html#g-socket-client-set-local-address" title="g_socket_client_set_local_address ()"><code class="function">g_socket_client_set_local_address()</code></a>. The socket type
  455. defaults to <a class="link" href="GSocket.html#G-SOCKET-TYPE-STREAM:CAPS"><code class="literal">G_SOCKET_TYPE_STREAM</code></a> but can be set with
  456. <a class="link" href="GSocketClient.html#g-socket-client-set-socket-type" title="g_socket_client_set_socket_type ()"><code class="function">g_socket_client_set_socket_type()</code></a>.</p>
  457. <p>If a local address is specified with <a class="link" href="GSocketClient.html#g-socket-client-set-local-address" title="g_socket_client_set_local_address ()"><code class="function">g_socket_client_set_local_address()</code></a> the
  458. socket will be bound to this address before connecting.</p>
  459. <div class="refsect3">
  460. <a name="g-socket-client-connect.parameters"></a><h4>Parameters</h4>
  461. <div class="informaltable"><table class="informaltable" width="100%" border="0">
  462. <colgroup>
  463. <col width="150px" class="parameters_name">
  464. <col class="parameters_description">
  465. <col width="200px" class="parameters_annotations">
  466. </colgroup>
  467. <tbody>
  468. <tr>
  469. <td class="parameter_name"><p>client</p></td>
  470. <td class="parameter_description"><p>a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>.</p></td>
  471. <td class="parameter_annotations"> </td>
  472. </tr>
  473. <tr>
  474. <td class="parameter_name"><p>connectable</p></td>
  475. <td class="parameter_description"><p>a <a class="link" href="GSocketConnectable.html" title="GSocketConnectable"><span class="type">GSocketConnectable</span></a> specifying the remote address.</p></td>
  476. <td class="parameter_annotations"> </td>
  477. </tr>
  478. <tr>
  479. <td class="parameter_name"><p>cancellable</p></td>
  480. <td class="parameter_description"><p> optional <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> object, <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore. </p></td>
  481. <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
  482. </tr>
  483. <tr>
  484. <td class="parameter_name"><p>error</p></td>
  485. <td class="parameter_description"><p><a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> for error reporting, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore.</p></td>
  486. <td class="parameter_annotations"> </td>
  487. </tr>
  488. </tbody>
  489. </table></div>
  490. </div>
  491. <div class="refsect3">
  492. <a name="g-socket-client-connect.returns"></a><h4>Returns</h4>
  493. <p> a <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a> on success, <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error. </p>
  494. <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
  495. </div>
  496. <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p>
  497. </div>
  498. <hr>
  499. <div class="refsect2">
  500. <a name="g-socket-client-connect-async"></a><h3>g_socket_client_connect_async ()</h3>
  501. <pre class="programlisting"><span class="returnvalue">void</span>
  502. g_socket_client_connect_async (<em class="parameter"><code><a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> *client</code></em>,
  503. <em class="parameter"><code><a class="link" href="GSocketConnectable.html" title="GSocketConnectable"><span class="type">GSocketConnectable</span></a> *connectable</code></em>,
  504. <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
  505. <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
  506. <em class="parameter"><code><a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
  507. <p>This is the asynchronous version of <a class="link" href="GSocketClient.html#g-socket-client-connect" title="g_socket_client_connect ()"><code class="function">g_socket_client_connect()</code></a>.</p>
  508. <p>When the operation is finished <em class="parameter"><code>callback</code></em>
  509. will be
  510. called. You can then call <a class="link" href="GSocketClient.html#g-socket-client-connect-finish" title="g_socket_client_connect_finish ()"><code class="function">g_socket_client_connect_finish()</code></a> to get
  511. the result of the operation.</p>
  512. <div class="refsect3">
  513. <a name="g-socket-client-connect-async.parameters"></a><h4>Parameters</h4>
  514. <div class="informaltable"><table class="informaltable" width="100%" border="0">
  515. <colgroup>
  516. <col width="150px" class="parameters_name">
  517. <col class="parameters_description">
  518. <col width="200px" class="parameters_annotations">
  519. </colgroup>
  520. <tbody>
  521. <tr>
  522. <td class="parameter_name"><p>client</p></td>
  523. <td class="parameter_description"><p>a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a></p></td>
  524. <td class="parameter_annotations"> </td>
  525. </tr>
  526. <tr>
  527. <td class="parameter_name"><p>connectable</p></td>
  528. <td class="parameter_description"><p>a <a class="link" href="GSocketConnectable.html" title="GSocketConnectable"><span class="type">GSocketConnectable</span></a> specifying the remote address.</p></td>
  529. <td class="parameter_annotations"> </td>
  530. </tr>
  531. <tr>
  532. <td class="parameter_name"><p>cancellable</p></td>
  533. <td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a>, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
  534. <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
  535. </tr>
  536. <tr>
  537. <td class="parameter_name"><p>callback</p></td>
  538. <td class="parameter_description"><p> a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a>. </p></td>
  539. <td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span></td>
  540. </tr>
  541. <tr>
  542. <td class="parameter_name"><p>user_data</p></td>
  543. <td class="parameter_description"><p> user data for the callback. </p></td>
  544. <td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td>
  545. </tr>
  546. </tbody>
  547. </table></div>
  548. </div>
  549. <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p>
  550. </div>
  551. <hr>
  552. <div class="refsect2">
  553. <a name="g-socket-client-connect-finish"></a><h3>g_socket_client_connect_finish ()</h3>
  554. <pre class="programlisting"><a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="returnvalue">GSocketConnection</span></a> *
  555. g_socket_client_connect_finish (<em class="parameter"><code><a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> *client</code></em>,
  556. <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>,
  557. <em class="parameter"><code><a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
  558. <p>Finishes an async connect operation. See <a class="link" href="GSocketClient.html#g-socket-client-connect-async" title="g_socket_client_connect_async ()"><code class="function">g_socket_client_connect_async()</code></a></p>
  559. <div class="refsect3">
  560. <a name="g-socket-client-connect-finish.parameters"></a><h4>Parameters</h4>
  561. <div class="informaltable"><table class="informaltable" width="100%" border="0">
  562. <colgroup>
  563. <col width="150px" class="parameters_name">
  564. <col class="parameters_description">
  565. <col width="200px" class="parameters_annotations">
  566. </colgroup>
  567. <tbody>
  568. <tr>
  569. <td class="parameter_name"><p>client</p></td>
  570. <td class="parameter_description"><p>a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>.</p></td>
  571. <td class="parameter_annotations"> </td>
  572. </tr>
  573. <tr>
  574. <td class="parameter_name"><p>result</p></td>
  575. <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a>.</p></td>
  576. <td class="parameter_annotations"> </td>
  577. </tr>
  578. <tr>
  579. <td class="parameter_name"><p>error</p></td>
  580. <td class="parameter_description"><p>a <a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> location to store the error occurring, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to
  581. ignore.</p></td>
  582. <td class="parameter_annotations"> </td>
  583. </tr>
  584. </tbody>
  585. </table></div>
  586. </div>
  587. <div class="refsect3">
  588. <a name="g-socket-client-connect-finish.returns"></a><h4>Returns</h4>
  589. <p> a <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a> on success, <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error. </p>
  590. <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
  591. </div>
  592. <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p>
  593. </div>
  594. <hr>
  595. <div class="refsect2">
  596. <a name="g-socket-client-connect-to-host"></a><h3>g_socket_client_connect_to_host ()</h3>
  597. <pre class="programlisting"><a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="returnvalue">GSocketConnection</span></a> *
  598. g_socket_client_connect_to_host (<em class="parameter"><code><a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> *client</code></em>,
  599. <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *host_and_port</code></em>,
  600. <em class="parameter"><code><a href="../glib-Basic-Types.html#guint16"><span class="type">guint16</span></a> default_port</code></em>,
  601. <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
  602. <em class="parameter"><code><a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
  603. <p>This is a helper function for <a class="link" href="GSocketClient.html#g-socket-client-connect" title="g_socket_client_connect ()"><code class="function">g_socket_client_connect()</code></a>.</p>
  604. <p>Attempts to create a TCP connection to the named host.</p>
  605. <p><em class="parameter"><code>host_and_port</code></em>
  606. may be in any of a number of recognized formats; an IPv6
  607. address, an IPv4 address, or a domain name (in which case a DNS
  608. lookup is performed). Quoting with [] is supported for all address
  609. types. A port override may be specified in the usual way with a
  610. colon. Ports may be given as decimal numbers or symbolic names (in
  611. which case an /etc/services lookup is performed).</p>
  612. <p>If no port override is given in <em class="parameter"><code>host_and_port</code></em>
  613. then <em class="parameter"><code>default_port</code></em>
  614. will be
  615. used as the port number to connect to.</p>
  616. <p>In general, <em class="parameter"><code>host_and_port</code></em>
  617. is expected to be provided by the user (allowing
  618. them to give the hostname, and a port override if necessary) and
  619. <em class="parameter"><code>default_port</code></em>
  620. is expected to be provided by the application.</p>
  621. <p>In the case that an IP address is given, a single connection
  622. attempt is made. In the case that a name is given, multiple
  623. connection attempts may be made, in turn and according to the
  624. number of address records in DNS, until a connection succeeds.</p>
  625. <p>Upon a successful connection, a new <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a> is constructed
  626. and returned. The caller owns this new object and must drop their
  627. reference to it when finished with it.</p>
  628. <p>In the event of any failure (DNS error, service not found, no hosts
  629. connectable) <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> is returned and <em class="parameter"><code>error</code></em>
  630. (if non-<a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>) is set
  631. accordingly.</p>
  632. <div class="refsect3">
  633. <a name="g-socket-client-connect-to-host.parameters"></a><h4>Parameters</h4>
  634. <div class="informaltable"><table class="informaltable" width="100%" border="0">
  635. <colgroup>
  636. <col width="150px" class="parameters_name">
  637. <col class="parameters_description">
  638. <col width="200px" class="parameters_annotations">
  639. </colgroup>
  640. <tbody>
  641. <tr>
  642. <td class="parameter_name"><p>client</p></td>
  643. <td class="parameter_description"><p>a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a></p></td>
  644. <td class="parameter_annotations"> </td>
  645. </tr>
  646. <tr>
  647. <td class="parameter_name"><p>host_and_port</p></td>
  648. <td class="parameter_description"><p>the name and optionally port of the host to connect to</p></td>
  649. <td class="parameter_annotations"> </td>
  650. </tr>
  651. <tr>
  652. <td class="parameter_name"><p>default_port</p></td>
  653. <td class="parameter_description"><p>the default port to connect to</p></td>
  654. <td class="parameter_annotations"> </td>
  655. </tr>
  656. <tr>
  657. <td class="parameter_name"><p>cancellable</p></td>
  658. <td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a>, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
  659. <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
  660. </tr>
  661. <tr>
  662. <td class="parameter_name"><p>error</p></td>
  663. <td class="parameter_description"><p>a pointer to a <a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
  664. <td class="parameter_annotations"> </td>
  665. </tr>
  666. </tbody>
  667. </table></div>
  668. </div>
  669. <div class="refsect3">
  670. <a name="g-socket-client-connect-to-host.returns"></a><h4>Returns</h4>
  671. <p> a <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a> on success, <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error. </p>
  672. <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
  673. </div>
  674. <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p>
  675. </div>
  676. <hr>
  677. <div class="refsect2">
  678. <a name="g-socket-client-connect-to-host-async"></a><h3>g_socket_client_connect_to_host_async ()</h3>
  679. <pre class="programlisting"><span class="returnvalue">void</span>
  680. g_socket_client_connect_to_host_async (<em class="parameter"><code><a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> *client</code></em>,
  681. <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *host_and_port</code></em>,
  682. <em class="parameter"><code><a href="../glib-Basic-Types.html#guint16"><span class="type">guint16</span></a> default_port</code></em>,
  683. <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
  684. <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
  685. <em class="parameter"><code><a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
  686. <p>This is the asynchronous version of <a class="link" href="GSocketClient.html#g-socket-client-connect-to-host" title="g_socket_client_connect_to_host ()"><code class="function">g_socket_client_connect_to_host()</code></a>.</p>
  687. <p>When the operation is finished <em class="parameter"><code>callback</code></em>
  688. will be
  689. called. You can then call <a class="link" href="GSocketClient.html#g-socket-client-connect-to-host-finish" title="g_socket_client_connect_to_host_finish ()"><code class="function">g_socket_client_connect_to_host_finish()</code></a> to get
  690. the result of the operation.</p>
  691. <div class="refsect3">
  692. <a name="g-socket-client-connect-to-host-async.parameters"></a><h4>Parameters</h4>
  693. <div class="informaltable"><table class="informaltable" width="100%" border="0">
  694. <colgroup>
  695. <col width="150px" class="parameters_name">
  696. <col class="parameters_description">
  697. <col width="200px" class="parameters_annotations">
  698. </colgroup>
  699. <tbody>
  700. <tr>
  701. <td class="parameter_name"><p>client</p></td>
  702. <td class="parameter_description"><p>a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a></p></td>
  703. <td class="parameter_annotations"> </td>
  704. </tr>
  705. <tr>
  706. <td class="parameter_name"><p>host_and_port</p></td>
  707. <td class="parameter_description"><p>the name and optionally the port of the host to connect to</p></td>
  708. <td class="parameter_annotations"> </td>
  709. </tr>
  710. <tr>
  711. <td class="parameter_name"><p>default_port</p></td>
  712. <td class="parameter_description"><p>the default port to connect to</p></td>
  713. <td class="parameter_annotations"> </td>
  714. </tr>
  715. <tr>
  716. <td class="parameter_name"><p>cancellable</p></td>
  717. <td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a>, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
  718. <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
  719. </tr>
  720. <tr>
  721. <td class="parameter_name"><p>callback</p></td>
  722. <td class="parameter_description"><p> a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a>. </p></td>
  723. <td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span></td>
  724. </tr>
  725. <tr>
  726. <td class="parameter_name"><p>user_data</p></td>
  727. <td class="parameter_description"><p> user data for the callback. </p></td>
  728. <td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td>
  729. </tr>
  730. </tbody>
  731. </table></div>
  732. </div>
  733. <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p>
  734. </div>
  735. <hr>
  736. <div class="refsect2">
  737. <a name="g-socket-client-connect-to-host-finish"></a><h3>g_socket_client_connect_to_host_finish ()</h3>
  738. <pre class="programlisting"><a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="returnvalue">GSocketConnection</span></a> *
  739. g_socket_client_connect_to_host_finish
  740. (<em class="parameter"><code><a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> *client</code></em>,
  741. <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>,
  742. <em class="parameter"><code><a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
  743. <p>Finishes an async connect operation. See <a class="link" href="GSocketClient.html#g-socket-client-connect-to-host-async" title="g_socket_client_connect_to_host_async ()"><code class="function">g_socket_client_connect_to_host_async()</code></a></p>
  744. <div class="refsect3">
  745. <a name="g-socket-client-connect-to-host-finish.parameters"></a><h4>Parameters</h4>
  746. <div class="informaltable"><table class="informaltable" width="100%" border="0">
  747. <colgroup>
  748. <col width="150px" class="parameters_name">
  749. <col class="parameters_description">
  750. <col width="200px" class="parameters_annotations">
  751. </colgroup>
  752. <tbody>
  753. <tr>
  754. <td class="parameter_name"><p>client</p></td>
  755. <td class="parameter_description"><p>a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>.</p></td>
  756. <td class="parameter_annotations"> </td>
  757. </tr>
  758. <tr>
  759. <td class="parameter_name"><p>result</p></td>
  760. <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a>.</p></td>
  761. <td class="parameter_annotations"> </td>
  762. </tr>
  763. <tr>
  764. <td class="parameter_name"><p>error</p></td>
  765. <td class="parameter_description"><p>a <a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> location to store the error occurring, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to
  766. ignore.</p></td>
  767. <td class="parameter_annotations"> </td>
  768. </tr>
  769. </tbody>
  770. </table></div>
  771. </div>
  772. <div class="refsect3">
  773. <a name="g-socket-client-connect-to-host-finish.returns"></a><h4>Returns</h4>
  774. <p> a <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a> on success, <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error. </p>
  775. <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
  776. </div>
  777. <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p>
  778. </div>
  779. <hr>
  780. <div class="refsect2">
  781. <a name="g-socket-client-connect-to-service"></a><h3>g_socket_client_connect_to_service ()</h3>
  782. <pre class="programlisting"><a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="returnvalue">GSocketConnection</span></a> *
  783. g_socket_client_connect_to_service (<em class="parameter"><code><a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> *client</code></em>,
  784. <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *domain</code></em>,
  785. <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *service</code></em>,
  786. <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
  787. <em class="parameter"><code><a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
  788. <p>Attempts to create a TCP connection to a service.</p>
  789. <p>This call looks up the SRV record for <em class="parameter"><code>service</code></em>
  790. at <em class="parameter"><code>domain</code></em>
  791. for the
  792. "tcp" protocol. It then attempts to connect, in turn, to each of
  793. the hosts providing the service until either a connection succeeds
  794. or there are no hosts remaining.</p>
  795. <p>Upon a successful connection, a new <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a> is constructed
  796. and returned. The caller owns this new object and must drop their
  797. reference to it when finished with it.</p>
  798. <p>In the event of any failure (DNS error, service not found, no hosts
  799. connectable) <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> is returned and <em class="parameter"><code>error</code></em>
  800. (if non-<a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>) is set
  801. accordingly.</p>
  802. <div class="refsect3">
  803. <a name="g-socket-client-connect-to-service.parameters"></a><h4>Parameters</h4>
  804. <div class="informaltable"><table class="informaltable" width="100%" border="0">
  805. <colgroup>
  806. <col width="150px" class="parameters_name">
  807. <col class="parameters_description">
  808. <col width="200px" class="parameters_annotations">
  809. </colgroup>
  810. <tbody>
  811. <tr>
  812. <td class="parameter_name"><p>client</p></td>
  813. <td class="parameter_description"><p>a <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a></p></td>
  814. <td class="parameter_annotations"> </td>
  815. </tr>
  816. <tr>
  817. <td class="parameter_name"><p>domain</p></td>
  818. <td class="parameter_description"><p>a domain name</p></td>
  819. <td class="parameter_annotations"> </td>
  820. </tr>
  821. <tr>
  822. <td class="parameter_name"><p>service</p></td>
  823. <td class="parameter_description"><p>the name of the service to connect to</p></td>
  824. <td class="parameter_annotations"> </td>
  825. </tr>
  826. <tr>
  827. <td class="parameter_name"><p>cancellable</p></td>
  828. <td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a>, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
  829. <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
  830. </tr>
  831. <tr>
  832. <td class="parameter_name"><p>error</p></td>
  833. <td class="parameter_description"><p>a pointer to a <a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
  834. <td class="parameter_annotations"> </td>
  835. </tr>
  836. </tbody>
  837. </table></div>
  838. </div>
  839. <div class="refsect3">
  840. <a name="g-socket-client-connect-to-service.returns"></a><h4>Returns</h4>
  841. <p> a <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a> if successful, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error. </p>
  842. <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
  843. </div>
  844. </div>
  845. <hr>
  846. <div class="refsect2">
  847. <a name="g-socket-client-connect-to-service-async"></a><h3>g_socket_client_connect_to_service_async ()</h3>
  848. <pre class="programlisting"><span class="returnvalue">void</span>
  849. g_socket_client_connect_to_service_async
  850. (<em class="parameter"><code><a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> *client</code></em>,
  851. <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *domain</code></em>,
  852. <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *service</code></em>,
  853. <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
  854. <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
  855. <em class="parameter"><code><a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
  856. <p>This is the asynchronous version of
  857. <a class="link" href="GSocketClient.html#g-socket-client-connect-to-service" title="g_socket_client_connect_to_service ()"><code class="function">g_socket_client_connect_to_service()</code></a>.</p>
  858. <div class="refsect3">
  859. <a name="g-socket-client-connect-to-service-async.parameters"></a><h4>Parameters</h4>
  860. <div class="informaltable"><table class="informaltable" width="100%" border="0">
  861. <colgroup>
  862. <col width="150px" class="parameters_name">
  863. <col class="parameters_description">
  864. <col width="200px" class="parameters_annotations">
  865. </colgroup>
  866. <tbody>
  867. <tr>
  868. <td class="parameter_name"><p>client</p></td>
  869. <td class="parameter_description"><p>a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a></p></td>
  870. <td class="parameter_annotations"> </td>
  871. </tr>
  872. <tr>
  873. <td class="parameter_name"><p>domain</p></td>
  874. <td class="parameter_description"><p>a domain name</p></td>
  875. <td class="parameter_annotations"> </td>
  876. </tr>
  877. <tr>
  878. <td class="parameter_name"><p>service</p></td>
  879. <td class="parameter_description"><p>the name of the service to connect to</p></td>
  880. <td class="parameter_annotations"> </td>
  881. </tr>
  882. <tr>
  883. <td class="parameter_name"><p>cancellable</p></td>
  884. <td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a>, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
  885. <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
  886. </tr>
  887. <tr>
  888. <td class="parameter_name"><p>callback</p></td>
  889. <td class="parameter_description"><p> a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a>. </p></td>
  890. <td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span></td>
  891. </tr>
  892. <tr>
  893. <td class="parameter_name"><p>user_data</p></td>
  894. <td class="parameter_description"><p> user data for the callback. </p></td>
  895. <td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td>
  896. </tr>
  897. </tbody>
  898. </table></div>
  899. </div>
  900. <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p>
  901. </div>
  902. <hr>
  903. <div class="refsect2">
  904. <a name="g-socket-client-connect-to-service-finish"></a><h3>g_socket_client_connect_to_service_finish ()</h3>
  905. <pre class="programlisting"><a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="returnvalue">GSocketConnection</span></a> *
  906. g_socket_client_connect_to_service_finish
  907. (<em class="parameter"><code><a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> *client</code></em>,
  908. <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>,
  909. <em class="parameter"><code><a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
  910. <p>Finishes an async connect operation. See <a class="link" href="GSocketClient.html#g-socket-client-connect-to-service-async" title="g_socket_client_connect_to_service_async ()"><code class="function">g_socket_client_connect_to_service_async()</code></a></p>
  911. <div class="refsect3">
  912. <a name="g-socket-client-connect-to-service-finish.parameters"></a><h4>Parameters</h4>
  913. <div class="informaltable"><table class="informaltable" width="100%" border="0">
  914. <colgroup>
  915. <col width="150px" class="parameters_name">
  916. <col class="parameters_description">
  917. <col width="200px" class="parameters_annotations">
  918. </colgroup>
  919. <tbody>
  920. <tr>
  921. <td class="parameter_name"><p>client</p></td>
  922. <td class="parameter_description"><p>a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>.</p></td>
  923. <td class="parameter_annotations"> </td>
  924. </tr>
  925. <tr>
  926. <td class="parameter_name"><p>result</p></td>
  927. <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a>.</p></td>
  928. <td class="parameter_annotations"> </td>
  929. </tr>
  930. <tr>
  931. <td class="parameter_name"><p>error</p></td>
  932. <td class="parameter_description"><p>a <a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> location to store the error occurring, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to
  933. ignore.</p></td>
  934. <td class="parameter_annotations"> </td>
  935. </tr>
  936. </tbody>
  937. </table></div>
  938. </div>
  939. <div class="refsect3">
  940. <a name="g-socket-client-connect-to-service-finish.returns"></a><h4>Returns</h4>
  941. <p> a <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a> on success, <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error. </p>
  942. <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
  943. </div>
  944. <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p>
  945. </div>
  946. <hr>
  947. <div class="refsect2">
  948. <a name="g-socket-client-connect-to-uri"></a><h3>g_socket_client_connect_to_uri ()</h3>
  949. <pre class="programlisting"><a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="returnvalue">GSocketConnection</span></a> *
  950. g_socket_client_connect_to_uri (<em class="parameter"><code><a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> *client</code></em>,
  951. <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *uri</code></em>,
  952. <em class="parameter"><code><a href="../glib-Basic-Types.html#guint16"><span class="type">guint16</span></a> default_port</code></em>,
  953. <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
  954. <em class="parameter"><code><a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
  955. <p>This is a helper function for <a class="link" href="GSocketClient.html#g-socket-client-connect" title="g_socket_client_connect ()"><code class="function">g_socket_client_connect()</code></a>.</p>
  956. <p>Attempts to create a TCP connection with a network URI.</p>
  957. <p><em class="parameter"><code>uri</code></em>
  958. may be any valid URI containing an "authority" (hostname/port)
  959. component. If a port is not specified in the URI, <em class="parameter"><code>default_port</code></em>
  960. will be used. TLS will be negotiated if <a class="link" href="GSocketClient.html#GSocketClient--tls" title="The “tls” property"><span class="type">tls</span></a> is <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>.
  961. (<a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> does not know to automatically assume TLS for
  962. certain URI schemes.)</p>
  963. <p>Using this rather than <a class="link" href="GSocketClient.html#g-socket-client-connect" title="g_socket_client_connect ()"><code class="function">g_socket_client_connect()</code></a> or
  964. <a class="link" href="GSocketClient.html#g-socket-client-connect-to-host" title="g_socket_client_connect_to_host ()"><code class="function">g_socket_client_connect_to_host()</code></a> allows <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> to
  965. determine when to use application-specific proxy protocols.</p>
  966. <p>Upon a successful connection, a new <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a> is constructed
  967. and returned. The caller owns this new object and must drop their
  968. reference to it when finished with it.</p>
  969. <p>In the event of any failure (DNS error, service not found, no hosts
  970. connectable) <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> is returned and <em class="parameter"><code>error</code></em>
  971. (if non-<a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>) is set
  972. accordingly.</p>
  973. <div class="refsect3">
  974. <a name="g-socket-client-connect-to-uri.parameters"></a><h4>Parameters</h4>
  975. <div class="informaltable"><table class="informaltable" width="100%" border="0">
  976. <colgroup>
  977. <col width="150px" class="parameters_name">
  978. <col class="parameters_description">
  979. <col width="200px" class="parameters_annotations">
  980. </colgroup>
  981. <tbody>
  982. <tr>
  983. <td class="parameter_name"><p>client</p></td>
  984. <td class="parameter_description"><p>a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a></p></td>
  985. <td class="parameter_annotations"> </td>
  986. </tr>
  987. <tr>
  988. <td class="parameter_name"><p>uri</p></td>
  989. <td class="parameter_description"><p>A network URI</p></td>
  990. <td class="parameter_annotations"> </td>
  991. </tr>
  992. <tr>
  993. <td class="parameter_name"><p>default_port</p></td>
  994. <td class="parameter_description"><p>the default port to connect to</p></td>
  995. <td class="parameter_annotations"> </td>
  996. </tr>
  997. <tr>
  998. <td class="parameter_name"><p>cancellable</p></td>
  999. <td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a>, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
  1000. <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
  1001. </tr>
  1002. <tr>
  1003. <td class="parameter_name"><p>error</p></td>
  1004. <td class="parameter_description"><p>a pointer to a <a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a>, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a></p></td>
  1005. <td class="parameter_annotations"> </td>
  1006. </tr>
  1007. </tbody>
  1008. </table></div>
  1009. </div>
  1010. <div class="refsect3">
  1011. <a name="g-socket-client-connect-to-uri.returns"></a><h4>Returns</h4>
  1012. <p> a <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a> on success, <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error. </p>
  1013. <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
  1014. </div>
  1015. <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p>
  1016. </div>
  1017. <hr>
  1018. <div class="refsect2">
  1019. <a name="g-socket-client-connect-to-uri-async"></a><h3>g_socket_client_connect_to_uri_async ()</h3>
  1020. <pre class="programlisting"><span class="returnvalue">void</span>
  1021. g_socket_client_connect_to_uri_async (<em class="parameter"><code><a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> *client</code></em>,
  1022. <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *uri</code></em>,
  1023. <em class="parameter"><code><a href="../glib-Basic-Types.html#guint16"><span class="type">guint16</span></a> default_port</code></em>,
  1024. <em class="parameter"><code><a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a> *cancellable</code></em>,
  1025. <em class="parameter"><code><a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
  1026. <em class="parameter"><code><a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
  1027. <p>This is the asynchronous version of <a class="link" href="GSocketClient.html#g-socket-client-connect-to-uri" title="g_socket_client_connect_to_uri ()"><code class="function">g_socket_client_connect_to_uri()</code></a>.</p>
  1028. <p>When the operation is finished <em class="parameter"><code>callback</code></em>
  1029. will be
  1030. called. You can then call <a class="link" href="GSocketClient.html#g-socket-client-connect-to-uri-finish" title="g_socket_client_connect_to_uri_finish ()"><code class="function">g_socket_client_connect_to_uri_finish()</code></a> to get
  1031. the result of the operation.</p>
  1032. <div class="refsect3">
  1033. <a name="g-socket-client-connect-to-uri-async.parameters"></a><h4>Parameters</h4>
  1034. <div class="informaltable"><table class="informaltable" width="100%" border="0">
  1035. <colgroup>
  1036. <col width="150px" class="parameters_name">
  1037. <col class="parameters_description">
  1038. <col width="200px" class="parameters_annotations">
  1039. </colgroup>
  1040. <tbody>
  1041. <tr>
  1042. <td class="parameter_name"><p>client</p></td>
  1043. <td class="parameter_description"><p>a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a></p></td>
  1044. <td class="parameter_annotations"> </td>
  1045. </tr>
  1046. <tr>
  1047. <td class="parameter_name"><p>uri</p></td>
  1048. <td class="parameter_description"><p>a network uri</p></td>
  1049. <td class="parameter_annotations"> </td>
  1050. </tr>
  1051. <tr>
  1052. <td class="parameter_name"><p>default_port</p></td>
  1053. <td class="parameter_description"><p>the default port to connect to</p></td>
  1054. <td class="parameter_annotations"> </td>
  1055. </tr>
  1056. <tr>
  1057. <td class="parameter_name"><p>cancellable</p></td>
  1058. <td class="parameter_description"><p> a <a class="link" href="GCancellable.html" title="GCancellable"><span class="type">GCancellable</span></a>, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
  1059. <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
  1060. </tr>
  1061. <tr>
  1062. <td class="parameter_name"><p>callback</p></td>
  1063. <td class="parameter_description"><p> a <a class="link" href="GAsyncResult.html#GAsyncReadyCallback" title="GAsyncReadyCallback ()"><span class="type">GAsyncReadyCallback</span></a>. </p></td>
  1064. <td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid until first called."><span class="acronym">scope async</span></acronym>]</span></td>
  1065. </tr>
  1066. <tr>
  1067. <td class="parameter_name"><p>user_data</p></td>
  1068. <td class="parameter_description"><p> user data for the callback. </p></td>
  1069. <td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td>
  1070. </tr>
  1071. </tbody>
  1072. </table></div>
  1073. </div>
  1074. <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p>
  1075. </div>
  1076. <hr>
  1077. <div class="refsect2">
  1078. <a name="g-socket-client-connect-to-uri-finish"></a><h3>g_socket_client_connect_to_uri_finish ()</h3>
  1079. <pre class="programlisting"><a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="returnvalue">GSocketConnection</span></a> *
  1080. g_socket_client_connect_to_uri_finish (<em class="parameter"><code><a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> *client</code></em>,
  1081. <em class="parameter"><code><a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a> *result</code></em>,
  1082. <em class="parameter"><code><a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
  1083. <p>Finishes an async connect operation. See <a class="link" href="GSocketClient.html#g-socket-client-connect-to-uri-async" title="g_socket_client_connect_to_uri_async ()"><code class="function">g_socket_client_connect_to_uri_async()</code></a></p>
  1084. <div class="refsect3">
  1085. <a name="g-socket-client-connect-to-uri-finish.parameters"></a><h4>Parameters</h4>
  1086. <div class="informaltable"><table class="informaltable" width="100%" border="0">
  1087. <colgroup>
  1088. <col width="150px" class="parameters_name">
  1089. <col class="parameters_description">
  1090. <col width="200px" class="parameters_annotations">
  1091. </colgroup>
  1092. <tbody>
  1093. <tr>
  1094. <td class="parameter_name"><p>client</p></td>
  1095. <td class="parameter_description"><p>a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>.</p></td>
  1096. <td class="parameter_annotations"> </td>
  1097. </tr>
  1098. <tr>
  1099. <td class="parameter_name"><p>result</p></td>
  1100. <td class="parameter_description"><p>a <a class="link" href="GAsyncResult.html" title="GAsyncResult"><span class="type">GAsyncResult</span></a>.</p></td>
  1101. <td class="parameter_annotations"> </td>
  1102. </tr>
  1103. <tr>
  1104. <td class="parameter_name"><p>error</p></td>
  1105. <td class="parameter_description"><p>a <a href="../glib-Error-Reporting.html#GError"><span class="type">GError</span></a> location to store the error occurring, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to
  1106. ignore.</p></td>
  1107. <td class="parameter_annotations"> </td>
  1108. </tr>
  1109. </tbody>
  1110. </table></div>
  1111. </div>
  1112. <div class="refsect3">
  1113. <a name="g-socket-client-connect-to-uri-finish.returns"></a><h4>Returns</h4>
  1114. <p> a <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a> on success, <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error. </p>
  1115. <p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
  1116. </div>
  1117. <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p>
  1118. </div>
  1119. <hr>
  1120. <div class="refsect2">
  1121. <a name="g-socket-client-set-family"></a><h3>g_socket_client_set_family ()</h3>
  1122. <pre class="programlisting"><span class="returnvalue">void</span>
  1123. g_socket_client_set_family (<em class="parameter"><code><a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> *client</code></em>,
  1124. <em class="parameter"><code><a class="link" href="GSocketAddress.html#GSocketFamily" title="enum GSocketFamily"><span class="type">GSocketFamily</span></a> family</code></em>);</pre>
  1125. <p>Sets the socket family of the socket client.
  1126. If this is set to something other than <a class="link" href="GSocketAddress.html#G-SOCKET-FAMILY-INVALID:CAPS"><code class="literal">G_SOCKET_FAMILY_INVALID</code></a>
  1127. then the sockets created by this object will be of the specified
  1128. family.</p>
  1129. <p>This might be useful for instance if you want to force the local
  1130. connection to be an ipv4 socket, even though the address might
  1131. be an ipv6 mapped to ipv4 address.</p>
  1132. <div class="refsect3">
  1133. <a name="g-socket-client-set-family.parameters"></a><h4>Parameters</h4>
  1134. <div class="informaltable"><table class="informaltable" width="100%" border="0">
  1135. <colgroup>
  1136. <col width="150px" class="parameters_name">
  1137. <col class="parameters_description">
  1138. <col width="200px" class="parameters_annotations">
  1139. </colgroup>
  1140. <tbody>
  1141. <tr>
  1142. <td class="parameter_name"><p>client</p></td>
  1143. <td class="parameter_description"><p>a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>.</p></td>
  1144. <td class="parameter_annotations"> </td>
  1145. </tr>
  1146. <tr>
  1147. <td class="parameter_name"><p>family</p></td>
  1148. <td class="parameter_description"><p>a <a class="link" href="GSocketAddress.html#GSocketFamily" title="enum GSocketFamily"><span class="type">GSocketFamily</span></a></p></td>
  1149. <td class="parameter_annotations"> </td>
  1150. </tr>
  1151. </tbody>
  1152. </table></div>
  1153. </div>
  1154. <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p>
  1155. </div>
  1156. <hr>
  1157. <div class="refsect2">
  1158. <a name="g-socket-client-set-local-address"></a><h3>g_socket_client_set_local_address ()</h3>
  1159. <pre class="programlisting"><span class="returnvalue">void</span>
  1160. g_socket_client_set_local_address (<em class="parameter"><code><a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> *client</code></em>,
  1161. <em class="parameter"><code><a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="type">GSocketAddress</span></a> *address</code></em>);</pre>
  1162. <p>Sets the local address of the socket client.
  1163. The sockets created by this object will bound to the
  1164. specified address (if not <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>) before connecting.</p>
  1165. <p>This is useful if you want to ensure that the local
  1166. side of the connection is on a specific port, or on
  1167. a specific interface.</p>
  1168. <div class="refsect3">
  1169. <a name="g-socket-client-set-local-address.parameters"></a><h4>Parameters</h4>
  1170. <div class="informaltable"><table class="informaltable" width="100%" border="0">
  1171. <colgroup>
  1172. <col width="150px" class="parameters_name">
  1173. <col class="parameters_description">
  1174. <col width="200px" class="parameters_annotations">
  1175. </colgroup>
  1176. <tbody>
  1177. <tr>
  1178. <td class="parameter_name"><p>client</p></td>
  1179. <td class="parameter_description"><p>a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>.</p></td>
  1180. <td class="parameter_annotations"> </td>
  1181. </tr>
  1182. <tr>
  1183. <td class="parameter_name"><p>address</p></td>
  1184. <td class="parameter_description"><p> a <a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="type">GSocketAddress</span></a>, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p></td>
  1185. <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
  1186. </tr>
  1187. </tbody>
  1188. </table></div>
  1189. </div>
  1190. <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p>
  1191. </div>
  1192. <hr>
  1193. <div class="refsect2">
  1194. <a name="g-socket-client-set-protocol"></a><h3>g_socket_client_set_protocol ()</h3>
  1195. <pre class="programlisting"><span class="returnvalue">void</span>
  1196. g_socket_client_set_protocol (<em class="parameter"><code><a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> *client</code></em>,
  1197. <em class="parameter"><code><a class="link" href="GSocket.html#GSocketProtocol" title="enum GSocketProtocol"><span class="type">GSocketProtocol</span></a> protocol</code></em>);</pre>
  1198. <p>Sets the protocol of the socket client.
  1199. The sockets created by this object will use of the specified
  1200. protocol.</p>
  1201. <p>If <em class="parameter"><code>protocol</code></em>
  1202. is <code class="literal">0</code> that means to use the default
  1203. protocol for the socket family and type.</p>
  1204. <div class="refsect3">
  1205. <a name="g-socket-client-set-protocol.parameters"></a><h4>Parameters</h4>
  1206. <div class="informaltable"><table class="informaltable" width="100%" border="0">
  1207. <colgroup>
  1208. <col width="150px" class="parameters_name">
  1209. <col class="parameters_description">
  1210. <col width="200px" class="parameters_annotations">
  1211. </colgroup>
  1212. <tbody>
  1213. <tr>
  1214. <td class="parameter_name"><p>client</p></td>
  1215. <td class="parameter_description"><p>a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>.</p></td>
  1216. <td class="parameter_annotations"> </td>
  1217. </tr>
  1218. <tr>
  1219. <td class="parameter_name"><p>protocol</p></td>
  1220. <td class="parameter_description"><p>a <a class="link" href="GSocket.html#GSocketProtocol" title="enum GSocketProtocol"><span class="type">GSocketProtocol</span></a></p></td>
  1221. <td class="parameter_annotations"> </td>
  1222. </tr>
  1223. </tbody>
  1224. </table></div>
  1225. </div>
  1226. <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p>
  1227. </div>
  1228. <hr>
  1229. <div class="refsect2">
  1230. <a name="g-socket-client-set-socket-type"></a><h3>g_socket_client_set_socket_type ()</h3>
  1231. <pre class="programlisting"><span class="returnvalue">void</span>
  1232. g_socket_client_set_socket_type (<em class="parameter"><code><a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> *client</code></em>,
  1233. <em class="parameter"><code><a class="link" href="GSocket.html#GSocketType" title="enum GSocketType"><span class="type">GSocketType</span></a> type</code></em>);</pre>
  1234. <p>Sets the socket type of the socket client.
  1235. The sockets created by this object will be of the specified
  1236. type.</p>
  1237. <p>It doesn't make sense to specify a type of <a class="link" href="GSocket.html#G-SOCKET-TYPE-DATAGRAM:CAPS"><code class="literal">G_SOCKET_TYPE_DATAGRAM</code></a>,
  1238. as GSocketClient is used for connection oriented services.</p>
  1239. <div class="refsect3">
  1240. <a name="g-socket-client-set-socket-type.parameters"></a><h4>Parameters</h4>
  1241. <div class="informaltable"><table class="informaltable" width="100%" border="0">
  1242. <colgroup>
  1243. <col width="150px" class="parameters_name">
  1244. <col class="parameters_description">
  1245. <col width="200px" class="parameters_annotations">
  1246. </colgroup>
  1247. <tbody>
  1248. <tr>
  1249. <td class="parameter_name"><p>client</p></td>
  1250. <td class="parameter_description"><p>a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>.</p></td>
  1251. <td class="parameter_annotations"> </td>
  1252. </tr>
  1253. <tr>
  1254. <td class="parameter_name"><p>type</p></td>
  1255. <td class="parameter_description"><p>a <a class="link" href="GSocket.html#GSocketType" title="enum GSocketType"><span class="type">GSocketType</span></a></p></td>
  1256. <td class="parameter_annotations"> </td>
  1257. </tr>
  1258. </tbody>
  1259. </table></div>
  1260. </div>
  1261. <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p>
  1262. </div>
  1263. <hr>
  1264. <div class="refsect2">
  1265. <a name="g-socket-client-set-timeout"></a><h3>g_socket_client_set_timeout ()</h3>
  1266. <pre class="programlisting"><span class="returnvalue">void</span>
  1267. g_socket_client_set_timeout (<em class="parameter"><code><a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> *client</code></em>,
  1268. <em class="parameter"><code><a href="../glib-Basic-Types.html#guint"><span class="type">guint</span></a> timeout</code></em>);</pre>
  1269. <p>Sets the I/O timeout for sockets created by <em class="parameter"><code>client</code></em>
  1270. . <em class="parameter"><code>timeout</code></em>
  1271. is a
  1272. time in seconds, or 0 for no timeout (the default).</p>
  1273. <p>The timeout value affects the initial connection attempt as well,
  1274. so setting this may cause calls to <a class="link" href="GSocketClient.html#g-socket-client-connect" title="g_socket_client_connect ()"><code class="function">g_socket_client_connect()</code></a>, etc,
  1275. to fail with <a class="link" href="gio-GIOError.html#G-IO-ERROR-TIMED-OUT:CAPS"><code class="literal">G_IO_ERROR_TIMED_OUT</code></a>.</p>
  1276. <div class="refsect3">
  1277. <a name="g-socket-client-set-timeout.parameters"></a><h4>Parameters</h4>
  1278. <div class="informaltable"><table class="informaltable" width="100%" border="0">
  1279. <colgroup>
  1280. <col width="150px" class="parameters_name">
  1281. <col class="parameters_description">
  1282. <col width="200px" class="parameters_annotations">
  1283. </colgroup>
  1284. <tbody>
  1285. <tr>
  1286. <td class="parameter_name"><p>client</p></td>
  1287. <td class="parameter_description"><p>a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>.</p></td>
  1288. <td class="parameter_annotations"> </td>
  1289. </tr>
  1290. <tr>
  1291. <td class="parameter_name"><p>timeout</p></td>
  1292. <td class="parameter_description"><p>the timeout</p></td>
  1293. <td class="parameter_annotations"> </td>
  1294. </tr>
  1295. </tbody>
  1296. </table></div>
  1297. </div>
  1298. <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p>
  1299. </div>
  1300. <hr>
  1301. <div class="refsect2">
  1302. <a name="g-socket-client-set-enable-proxy"></a><h3>g_socket_client_set_enable_proxy ()</h3>
  1303. <pre class="programlisting"><span class="returnvalue">void</span>
  1304. g_socket_client_set_enable_proxy (<em class="parameter"><code><a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> *client</code></em>,
  1305. <em class="parameter"><code><a href="../glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> enable</code></em>);</pre>
  1306. <p>Sets whether or not <em class="parameter"><code>client</code></em>
  1307. attempts to make connections via a
  1308. proxy server. When enabled (the default), <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> will use a
  1309. <a class="link" href="GProxyResolver.html" title="GProxyResolver"><span class="type">GProxyResolver</span></a> to determine if a proxy protocol such as SOCKS is
  1310. needed, and automatically do the necessary proxy negotiation.</p>
  1311. <p>See also <a class="link" href="GSocketClient.html#g-socket-client-set-proxy-resolver" title="g_socket_client_set_proxy_resolver ()"><code class="function">g_socket_client_set_proxy_resolver()</code></a>.</p>
  1312. <div class="refsect3">
  1313. <a name="g-socket-client-set-enable-proxy.parameters"></a><h4>Parameters</h4>
  1314. <div class="informaltable"><table class="informaltable" width="100%" border="0">
  1315. <colgroup>
  1316. <col width="150px" class="parameters_name">
  1317. <col class="parameters_description">
  1318. <col width="200px" class="parameters_annotations">
  1319. </colgroup>
  1320. <tbody>
  1321. <tr>
  1322. <td class="parameter_name"><p>client</p></td>
  1323. <td class="parameter_description"><p>a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>.</p></td>
  1324. <td class="parameter_annotations"> </td>
  1325. </tr>
  1326. <tr>
  1327. <td class="parameter_name"><p>enable</p></td>
  1328. <td class="parameter_description"><p>whether to enable proxies</p></td>
  1329. <td class="parameter_annotations"> </td>
  1330. </tr>
  1331. </tbody>
  1332. </table></div>
  1333. </div>
  1334. <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p>
  1335. </div>
  1336. <hr>
  1337. <div class="refsect2">
  1338. <a name="g-socket-client-set-proxy-resolver"></a><h3>g_socket_client_set_proxy_resolver ()</h3>
  1339. <pre class="programlisting"><span class="returnvalue">void</span>
  1340. g_socket_client_set_proxy_resolver (<em class="parameter"><code><a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> *client</code></em>,
  1341. <em class="parameter"><code><a class="link" href="GProxyResolver.html" title="GProxyResolver"><span class="type">GProxyResolver</span></a> *proxy_resolver</code></em>);</pre>
  1342. <p>Overrides the <a class="link" href="GProxyResolver.html" title="GProxyResolver"><span class="type">GProxyResolver</span></a> used by <em class="parameter"><code>client</code></em>
  1343. . You can call this if
  1344. you want to use specific proxies, rather than using the system
  1345. default proxy settings.</p>
  1346. <p>Note that whether or not the proxy resolver is actually used
  1347. depends on the setting of <a class="link" href="GSocketClient.html#GSocketClient--enable-proxy" title="The “enable-proxy” property"><span class="type">enable-proxy</span></a>, which is not
  1348. changed by this function (but which is <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> by default)</p>
  1349. <div class="refsect3">
  1350. <a name="g-socket-client-set-proxy-resolver.parameters"></a><h4>Parameters</h4>
  1351. <div class="informaltable"><table class="informaltable" width="100%" border="0">
  1352. <colgroup>
  1353. <col width="150px" class="parameters_name">
  1354. <col class="parameters_description">
  1355. <col width="200px" class="parameters_annotations">
  1356. </colgroup>
  1357. <tbody>
  1358. <tr>
  1359. <td class="parameter_name"><p>client</p></td>
  1360. <td class="parameter_description"><p>a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>.</p></td>
  1361. <td class="parameter_annotations"> </td>
  1362. </tr>
  1363. <tr>
  1364. <td class="parameter_name"><p>proxy_resolver</p></td>
  1365. <td class="parameter_description"><p> a <a class="link" href="GProxyResolver.html" title="GProxyResolver"><span class="type">GProxyResolver</span></a>, or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> for the
  1366. default. </p></td>
  1367. <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
  1368. </tr>
  1369. </tbody>
  1370. </table></div>
  1371. </div>
  1372. <p class="since">Since: <a class="link" href="api-index-2-36.html#api-index-2.36">2.36</a></p>
  1373. </div>
  1374. <hr>
  1375. <div class="refsect2">
  1376. <a name="g-socket-client-set-tls"></a><h3>g_socket_client_set_tls ()</h3>
  1377. <pre class="programlisting"><span class="returnvalue">void</span>
  1378. g_socket_client_set_tls (<em class="parameter"><code><a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> *client</code></em>,
  1379. <em class="parameter"><code><a href="../glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> tls</code></em>);</pre>
  1380. <p>Sets whether <em class="parameter"><code>client</code></em>
  1381. creates TLS (aka SSL) connections. If <em class="parameter"><code>tls</code></em>
  1382. is
  1383. <a href="../glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, <em class="parameter"><code>client</code></em>
  1384. will wrap its connections in a <a class="link" href="GTlsClientConnection.html" title="GTlsClientConnection"><span class="type">GTlsClientConnection</span></a>
  1385. and perform a TLS handshake when connecting.</p>
  1386. <p>Note that since <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> must return a <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a>,
  1387. but <a class="link" href="GTlsClientConnection.html" title="GTlsClientConnection"><span class="type">GTlsClientConnection</span></a> is not a <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a>, this
  1388. actually wraps the resulting <a class="link" href="GTlsClientConnection.html" title="GTlsClientConnection"><span class="type">GTlsClientConnection</span></a> in a
  1389. <a class="link" href="GTcpWrapperConnection.html" title="GTcpWrapperConnection"><span class="type">GTcpWrapperConnection</span></a> when returning it. You can use
  1390. <a class="link" href="GTcpWrapperConnection.html#g-tcp-wrapper-connection-get-base-io-stream" title="g_tcp_wrapper_connection_get_base_io_stream ()"><code class="function">g_tcp_wrapper_connection_get_base_io_stream()</code></a> on the return value
  1391. to extract the <a class="link" href="GTlsClientConnection.html" title="GTlsClientConnection"><span class="type">GTlsClientConnection</span></a>.</p>
  1392. <p>If you need to modify the behavior of the TLS handshake (eg, by
  1393. setting a client-side certificate to use, or connecting to the
  1394. <a class="link" href="GTlsConnection.html#GTlsConnection-accept-certificate" title="The “accept-certificate” signal"><span class="type">accept-certificate</span></a> signal), you can connect to
  1395. <em class="parameter"><code>client</code></em>
  1396. 's <a class="link" href="GSocketClient.html#GSocketClient-event" title="The “event” signal"><span class="type">“event”</span></a> signal and wait for it to be
  1397. emitted with <a class="link" href="GSocketClient.html#G-SOCKET-CLIENT-TLS-HANDSHAKING:CAPS"><code class="literal">G_SOCKET_CLIENT_TLS_HANDSHAKING</code></a>, which will give you
  1398. a chance to see the <a class="link" href="GTlsClientConnection.html" title="GTlsClientConnection"><span class="type">GTlsClientConnection</span></a> before the handshake
  1399. starts.</p>
  1400. <div class="refsect3">
  1401. <a name="g-socket-client-set-tls.parameters"></a><h4>Parameters</h4>
  1402. <div class="informaltable"><table class="informaltable" width="100%" border="0">
  1403. <colgroup>
  1404. <col width="150px" class="parameters_name">
  1405. <col class="parameters_description">
  1406. <col width="200px" class="parameters_annotations">
  1407. </colgroup>
  1408. <tbody>
  1409. <tr>
  1410. <td class="parameter_name"><p>client</p></td>
  1411. <td class="parameter_description"><p>a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>.</p></td>
  1412. <td class="parameter_annotations"> </td>
  1413. </tr>
  1414. <tr>
  1415. <td class="parameter_name"><p>tls</p></td>
  1416. <td class="parameter_description"><p>whether to use TLS</p></td>
  1417. <td class="parameter_annotations"> </td>
  1418. </tr>
  1419. </tbody>
  1420. </table></div>
  1421. </div>
  1422. <p class="since">Since: <a class="link" href="api-index-2-28.html#api-index-2.28">2.28</a></p>
  1423. </div>
  1424. <hr>
  1425. <div class="refsect2">
  1426. <a name="g-socket-client-set-tls-validation-flags"></a><h3>g_socket_client_set_tls_validation_flags ()</h3>
  1427. <pre class="programlisting"><span class="returnvalue">void</span>
  1428. g_socket_client_set_tls_validation_flags
  1429. (<em class="parameter"><code><a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> *client</code></em>,
  1430. <em class="parameter"><code><a class="link" href="gio-TLS-Overview.html#GTlsCertificateFlags" title="enum GTlsCertificateFlags"><span class="type">GTlsCertificateFlags</span></a> flags</code></em>);</pre>
  1431. <p>Sets the TLS validation flags used when creating TLS connections
  1432. via <em class="parameter"><code>client</code></em>
  1433. . The default value is <a class="link" href="gio-TLS-Overview.html#G-TLS-CERTIFICATE-VALIDATE-ALL:CAPS"><code class="literal">G_TLS_CERTIFICATE_VALIDATE_ALL</code></a>.</p>
  1434. <div class="refsect3">
  1435. <a name="g-socket-client-set-tls-validation-flags.parameters"></a><h4>Parameters</h4>
  1436. <div class="informaltable"><table class="informaltable" width="100%" border="0">
  1437. <colgroup>
  1438. <col width="150px" class="parameters_name">
  1439. <col class="parameters_description">
  1440. <col width="200px" class="parameters_annotations">
  1441. </colgroup>
  1442. <tbody>
  1443. <tr>
  1444. <td class="parameter_name"><p>client</p></td>
  1445. <td class="parameter_description"><p>a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>.</p></td>
  1446. <td class="parameter_annotations"> </td>
  1447. </tr>
  1448. <tr>
  1449. <td class="parameter_name"><p>flags</p></td>
  1450. <td class="parameter_description"><p>the validation flags</p></td>
  1451. <td class="parameter_annotations"> </td>
  1452. </tr>
  1453. </tbody>
  1454. </table></div>
  1455. </div>
  1456. <p class="since">Since: <a class="link" href="api-index-2-28.html#api-index-2.28">2.28</a></p>
  1457. </div>
  1458. <hr>
  1459. <div class="refsect2">
  1460. <a name="g-socket-client-get-family"></a><h3>g_socket_client_get_family ()</h3>
  1461. <pre class="programlisting"><a class="link" href="GSocketAddress.html#GSocketFamily" title="enum GSocketFamily"><span class="returnvalue">GSocketFamily</span></a>
  1462. g_socket_client_get_family (<em class="parameter"><code><a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> *client</code></em>);</pre>
  1463. <p>Gets the socket family of the socket client.</p>
  1464. <p>See <a class="link" href="GSocketClient.html#g-socket-client-set-family" title="g_socket_client_set_family ()"><code class="function">g_socket_client_set_family()</code></a> for details.</p>
  1465. <div class="refsect3">
  1466. <a name="g-socket-client-get-family.parameters"></a><h4>Parameters</h4>
  1467. <div class="informaltable"><table class="informaltable" width="100%" border="0">
  1468. <colgroup>
  1469. <col width="150px" class="parameters_name">
  1470. <col class="parameters_description">
  1471. <col width="200px" class="parameters_annotations">
  1472. </colgroup>
  1473. <tbody><tr>
  1474. <td class="parameter_name"><p>client</p></td>
  1475. <td class="parameter_description"><p>a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>.</p></td>
  1476. <td class="parameter_annotations"> </td>
  1477. </tr></tbody>
  1478. </table></div>
  1479. </div>
  1480. <div class="refsect3">
  1481. <a name="g-socket-client-get-family.returns"></a><h4>Returns</h4>
  1482. <p> a <a class="link" href="GSocketAddress.html#GSocketFamily" title="enum GSocketFamily"><span class="type">GSocketFamily</span></a></p>
  1483. </div>
  1484. <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p>
  1485. </div>
  1486. <hr>
  1487. <div class="refsect2">
  1488. <a name="g-socket-client-get-local-address"></a><h3>g_socket_client_get_local_address ()</h3>
  1489. <pre class="programlisting"><a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="returnvalue">GSocketAddress</span></a> *
  1490. g_socket_client_get_local_address (<em class="parameter"><code><a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> *client</code></em>);</pre>
  1491. <p>Gets the local address of the socket client.</p>
  1492. <p>See <a class="link" href="GSocketClient.html#g-socket-client-set-local-address" title="g_socket_client_set_local_address ()"><code class="function">g_socket_client_set_local_address()</code></a> for details.</p>
  1493. <div class="refsect3">
  1494. <a name="g-socket-client-get-local-address.parameters"></a><h4>Parameters</h4>
  1495. <div class="informaltable"><table class="informaltable" width="100%" border="0">
  1496. <colgroup>
  1497. <col width="150px" class="parameters_name">
  1498. <col class="parameters_description">
  1499. <col width="200px" class="parameters_annotations">
  1500. </colgroup>
  1501. <tbody><tr>
  1502. <td class="parameter_name"><p>client</p></td>
  1503. <td class="parameter_description"><p>a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>.</p></td>
  1504. <td class="parameter_annotations"> </td>
  1505. </tr></tbody>
  1506. </table></div>
  1507. </div>
  1508. <div class="refsect3">
  1509. <a name="g-socket-client-get-local-address.returns"></a><h4>Returns</h4>
  1510. <p> a <a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="type">GSocketAddress</span></a> or <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. Do not free. </p>
  1511. <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
  1512. </div>
  1513. <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p>
  1514. </div>
  1515. <hr>
  1516. <div class="refsect2">
  1517. <a name="g-socket-client-get-protocol"></a><h3>g_socket_client_get_protocol ()</h3>
  1518. <pre class="programlisting"><a class="link" href="GSocket.html#GSocketProtocol" title="enum GSocketProtocol"><span class="returnvalue">GSocketProtocol</span></a>
  1519. g_socket_client_get_protocol (<em class="parameter"><code><a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> *client</code></em>);</pre>
  1520. <p>Gets the protocol name type of the socket client.</p>
  1521. <p>See <a class="link" href="GSocketClient.html#g-socket-client-set-protocol" title="g_socket_client_set_protocol ()"><code class="function">g_socket_client_set_protocol()</code></a> for details.</p>
  1522. <div class="refsect3">
  1523. <a name="g-socket-client-get-protocol.parameters"></a><h4>Parameters</h4>
  1524. <div class="informaltable"><table class="informaltable" width="100%" border="0">
  1525. <colgroup>
  1526. <col width="150px" class="parameters_name">
  1527. <col class="parameters_description">
  1528. <col width="200px" class="parameters_annotations">
  1529. </colgroup>
  1530. <tbody><tr>
  1531. <td class="parameter_name"><p>client</p></td>
  1532. <td class="parameter_description"><p>a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a></p></td>
  1533. <td class="parameter_annotations"> </td>
  1534. </tr></tbody>
  1535. </table></div>
  1536. </div>
  1537. <div class="refsect3">
  1538. <a name="g-socket-client-get-protocol.returns"></a><h4>Returns</h4>
  1539. <p> a <a class="link" href="GSocket.html#GSocketProtocol" title="enum GSocketProtocol"><span class="type">GSocketProtocol</span></a></p>
  1540. </div>
  1541. <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p>
  1542. </div>
  1543. <hr>
  1544. <div class="refsect2">
  1545. <a name="g-socket-client-get-socket-type"></a><h3>g_socket_client_get_socket_type ()</h3>
  1546. <pre class="programlisting"><a class="link" href="GSocket.html#GSocketType" title="enum GSocketType"><span class="returnvalue">GSocketType</span></a>
  1547. g_socket_client_get_socket_type (<em class="parameter"><code><a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> *client</code></em>);</pre>
  1548. <p>Gets the socket type of the socket client.</p>
  1549. <p>See <a class="link" href="GSocketClient.html#g-socket-client-set-socket-type" title="g_socket_client_set_socket_type ()"><code class="function">g_socket_client_set_socket_type()</code></a> for details.</p>
  1550. <div class="refsect3">
  1551. <a name="g-socket-client-get-socket-type.parameters"></a><h4>Parameters</h4>
  1552. <div class="informaltable"><table class="informaltable" width="100%" border="0">
  1553. <colgroup>
  1554. <col width="150px" class="parameters_name">
  1555. <col class="parameters_description">
  1556. <col width="200px" class="parameters_annotations">
  1557. </colgroup>
  1558. <tbody><tr>
  1559. <td class="parameter_name"><p>client</p></td>
  1560. <td class="parameter_description"><p>a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>.</p></td>
  1561. <td class="parameter_annotations"> </td>
  1562. </tr></tbody>
  1563. </table></div>
  1564. </div>
  1565. <div class="refsect3">
  1566. <a name="g-socket-client-get-socket-type.returns"></a><h4>Returns</h4>
  1567. <p> a <a class="link" href="GSocketAddress.html#GSocketFamily" title="enum GSocketFamily"><span class="type">GSocketFamily</span></a></p>
  1568. </div>
  1569. <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p>
  1570. </div>
  1571. <hr>
  1572. <div class="refsect2">
  1573. <a name="g-socket-client-get-timeout"></a><h3>g_socket_client_get_timeout ()</h3>
  1574. <pre class="programlisting"><a href="../glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>
  1575. g_socket_client_get_timeout (<em class="parameter"><code><a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> *client</code></em>);</pre>
  1576. <p>Gets the I/O timeout time for sockets created by <em class="parameter"><code>client</code></em>
  1577. .</p>
  1578. <p>See <a class="link" href="GSocketClient.html#g-socket-client-set-timeout" title="g_socket_client_set_timeout ()"><code class="function">g_socket_client_set_timeout()</code></a> for details.</p>
  1579. <div class="refsect3">
  1580. <a name="g-socket-client-get-timeout.parameters"></a><h4>Parameters</h4>
  1581. <div class="informaltable"><table class="informaltable" width="100%" border="0">
  1582. <colgroup>
  1583. <col width="150px" class="parameters_name">
  1584. <col class="parameters_description">
  1585. <col width="200px" class="parameters_annotations">
  1586. </colgroup>
  1587. <tbody><tr>
  1588. <td class="parameter_name"><p>client</p></td>
  1589. <td class="parameter_description"><p>a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a></p></td>
  1590. <td class="parameter_annotations"> </td>
  1591. </tr></tbody>
  1592. </table></div>
  1593. </div>
  1594. <div class="refsect3">
  1595. <a name="g-socket-client-get-timeout.returns"></a><h4>Returns</h4>
  1596. <p> the timeout in seconds</p>
  1597. </div>
  1598. <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p>
  1599. </div>
  1600. <hr>
  1601. <div class="refsect2">
  1602. <a name="g-socket-client-get-enable-proxy"></a><h3>g_socket_client_get_enable_proxy ()</h3>
  1603. <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
  1604. g_socket_client_get_enable_proxy (<em class="parameter"><code><a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> *client</code></em>);</pre>
  1605. <p>Gets the proxy enable state; see <a class="link" href="GSocketClient.html#g-socket-client-set-enable-proxy" title="g_socket_client_set_enable_proxy ()"><code class="function">g_socket_client_set_enable_proxy()</code></a></p>
  1606. <div class="refsect3">
  1607. <a name="g-socket-client-get-enable-proxy.parameters"></a><h4>Parameters</h4>
  1608. <div class="informaltable"><table class="informaltable" width="100%" border="0">
  1609. <colgroup>
  1610. <col width="150px" class="parameters_name">
  1611. <col class="parameters_description">
  1612. <col width="200px" class="parameters_annotations">
  1613. </colgroup>
  1614. <tbody><tr>
  1615. <td class="parameter_name"><p>client</p></td>
  1616. <td class="parameter_description"><p>a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>.</p></td>
  1617. <td class="parameter_annotations"> </td>
  1618. </tr></tbody>
  1619. </table></div>
  1620. </div>
  1621. <div class="refsect3">
  1622. <a name="g-socket-client-get-enable-proxy.returns"></a><h4>Returns</h4>
  1623. <p> whether proxying is enabled</p>
  1624. </div>
  1625. <p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p>
  1626. </div>
  1627. <hr>
  1628. <div class="refsect2">
  1629. <a name="g-socket-client-get-proxy-resolver"></a><h3>g_socket_client_get_proxy_resolver ()</h3>
  1630. <pre class="programlisting"><a class="link" href="GProxyResolver.html" title="GProxyResolver"><span class="returnvalue">GProxyResolver</span></a> *
  1631. g_socket_client_get_proxy_resolver (<em class="parameter"><code><a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> *client</code></em>);</pre>
  1632. <p>Gets the <a class="link" href="GProxyResolver.html" title="GProxyResolver"><span class="type">GProxyResolver</span></a> being used by <em class="parameter"><code>client</code></em>
  1633. . Normally, this will
  1634. be the resolver returned by <a class="link" href="GProxyResolver.html#g-proxy-resolver-get-default" title="g_proxy_resolver_get_default ()"><code class="function">g_proxy_resolver_get_default()</code></a>, but you
  1635. can override it with <a class="link" href="GSocketClient.html#g-socket-client-set-proxy-resolver" title="g_socket_client_set_proxy_resolver ()"><code class="function">g_socket_client_set_proxy_resolver()</code></a>.</p>
  1636. <div class="refsect3">
  1637. <a name="g-socket-client-get-proxy-resolver.parameters"></a><h4>Parameters</h4>
  1638. <div class="informaltable"><table class="informaltable" width="100%" border="0">
  1639. <colgroup>
  1640. <col width="150px" class="parameters_name">
  1641. <col class="parameters_description">
  1642. <col width="200px" class="parameters_annotations">
  1643. </colgroup>
  1644. <tbody><tr>
  1645. <td class="parameter_name"><p>client</p></td>
  1646. <td class="parameter_description"><p>a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>.</p></td>
  1647. <td class="parameter_annotations"> </td>
  1648. </tr></tbody>
  1649. </table></div>
  1650. </div>
  1651. <div class="refsect3">
  1652. <a name="g-socket-client-get-proxy-resolver.returns"></a><h4>Returns</h4>
  1653. <p> The <a class="link" href="GProxyResolver.html" title="GProxyResolver"><span class="type">GProxyResolver</span></a> being used by
  1654. <em class="parameter"><code>client</code></em>
  1655. . </p>
  1656. <p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
  1657. </div>
  1658. <p class="since">Since: <a class="link" href="api-index-2-36.html#api-index-2.36">2.36</a></p>
  1659. </div>
  1660. <hr>
  1661. <div class="refsect2">
  1662. <a name="g-socket-client-get-tls"></a><h3>g_socket_client_get_tls ()</h3>
  1663. <pre class="programlisting"><a href="../glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>
  1664. g_socket_client_get_tls (<em class="parameter"><code><a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> *client</code></em>);</pre>
  1665. <p>Gets whether <em class="parameter"><code>client</code></em>
  1666. creates TLS connections. See
  1667. <a class="link" href="GSocketClient.html#g-socket-client-set-tls" title="g_socket_client_set_tls ()"><code class="function">g_socket_client_set_tls()</code></a> for details.</p>
  1668. <div class="refsect3">
  1669. <a name="g-socket-client-get-tls.parameters"></a><h4>Parameters</h4>
  1670. <div class="informaltable"><table class="informaltable" width="100%" border="0">
  1671. <colgroup>
  1672. <col width="150px" class="parameters_name">
  1673. <col class="parameters_description">
  1674. <col width="200px" class="parameters_annotations">
  1675. </colgroup>
  1676. <tbody><tr>
  1677. <td class="parameter_name"><p>client</p></td>
  1678. <td class="parameter_description"><p>a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>.</p></td>
  1679. <td class="parameter_annotations"> </td>
  1680. </tr></tbody>
  1681. </table></div>
  1682. </div>
  1683. <div class="refsect3">
  1684. <a name="g-socket-client-get-tls.returns"></a><h4>Returns</h4>
  1685. <p> whether <em class="parameter"><code>client</code></em>
  1686. uses TLS</p>
  1687. </div>
  1688. <p class="since">Since: <a class="link" href="api-index-2-28.html#api-index-2.28">2.28</a></p>
  1689. </div>
  1690. <hr>
  1691. <div class="refsect2">
  1692. <a name="g-socket-client-get-tls-validation-flags"></a><h3>g_socket_client_get_tls_validation_flags ()</h3>
  1693. <pre class="programlisting"><a class="link" href="gio-TLS-Overview.html#GTlsCertificateFlags" title="enum GTlsCertificateFlags"><span class="returnvalue">GTlsCertificateFlags</span></a>
  1694. g_socket_client_get_tls_validation_flags
  1695. (<em class="parameter"><code><a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> *client</code></em>);</pre>
  1696. <p>Gets the TLS validation flags used creating TLS connections via
  1697. <em class="parameter"><code>client</code></em>
  1698. .</p>
  1699. <div class="refsect3">
  1700. <a name="g-socket-client-get-tls-validation-flags.parameters"></a><h4>Parameters</h4>
  1701. <div class="informaltable"><table class="informaltable" width="100%" border="0">
  1702. <colgroup>
  1703. <col width="150px" class="parameters_name">
  1704. <col class="parameters_description">
  1705. <col width="200px" class="parameters_annotations">
  1706. </colgroup>
  1707. <tbody><tr>
  1708. <td class="parameter_name"><p>client</p></td>
  1709. <td class="parameter_description"><p>a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>.</p></td>
  1710. <td class="parameter_annotations"> </td>
  1711. </tr></tbody>
  1712. </table></div>
  1713. </div>
  1714. <div class="refsect3">
  1715. <a name="g-socket-client-get-tls-validation-flags.returns"></a><h4>Returns</h4>
  1716. <p> the TLS validation flags</p>
  1717. </div>
  1718. <p class="since">Since: <a class="link" href="api-index-2-28.html#api-index-2.28">2.28</a></p>
  1719. </div>
  1720. <hr>
  1721. <div class="refsect2">
  1722. <a name="g-socket-client-add-application-proxy"></a><h3>g_socket_client_add_application_proxy ()</h3>
  1723. <pre class="programlisting"><span class="returnvalue">void</span>
  1724. g_socket_client_add_application_proxy (<em class="parameter"><code><a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> *client</code></em>,
  1725. <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *protocol</code></em>);</pre>
  1726. <p>Enable proxy protocols to be handled by the application. When the
  1727. indicated proxy protocol is returned by the <a class="link" href="GProxyResolver.html" title="GProxyResolver"><span class="type">GProxyResolver</span></a>,
  1728. <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> will consider this protocol as supported but will
  1729. not try to find a <a class="link" href="GProxy.html" title="GProxy"><span class="type">GProxy</span></a> instance to handle handshaking. The
  1730. application must check for this case by calling
  1731. <a class="link" href="GSocketConnection.html#g-socket-connection-get-remote-address" title="g_socket_connection_get_remote_address ()"><code class="function">g_socket_connection_get_remote_address()</code></a> on the returned
  1732. <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a>, and seeing if it's a <a class="link" href="GProxyAddress.html" title="GProxyAddress"><span class="type">GProxyAddress</span></a> of the
  1733. appropriate type, to determine whether or not it needs to handle
  1734. the proxy handshaking itself.</p>
  1735. <p>This should be used for proxy protocols that are dialects of
  1736. another protocol such as HTTP proxy. It also allows cohabitation of
  1737. proxy protocols that are reused between protocols. A good example
  1738. is HTTP. It can be used to proxy HTTP, FTP and Gopher and can also
  1739. be use as generic socket proxy through the HTTP CONNECT method.</p>
  1740. <p>When the proxy is detected as being an application proxy, TLS handshake
  1741. will be skipped. This is required to let the application do the proxy
  1742. specific handshake.</p>
  1743. <div class="refsect3">
  1744. <a name="g-socket-client-add-application-proxy.parameters"></a><h4>Parameters</h4>
  1745. <div class="informaltable"><table class="informaltable" width="100%" border="0">
  1746. <colgroup>
  1747. <col width="150px" class="parameters_name">
  1748. <col class="parameters_description">
  1749. <col width="200px" class="parameters_annotations">
  1750. </colgroup>
  1751. <tbody>
  1752. <tr>
  1753. <td class="parameter_name"><p>client</p></td>
  1754. <td class="parameter_description"><p>a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a></p></td>
  1755. <td class="parameter_annotations"> </td>
  1756. </tr>
  1757. <tr>
  1758. <td class="parameter_name"><p>protocol</p></td>
  1759. <td class="parameter_description"><p>The proxy protocol</p></td>
  1760. <td class="parameter_annotations"> </td>
  1761. </tr>
  1762. </tbody>
  1763. </table></div>
  1764. </div>
  1765. </div>
  1766. </div>
  1767. <div class="refsect1">
  1768. <a name="GSocketClient.other_details"></a><h2>Types and Values</h2>
  1769. <div class="refsect2">
  1770. <a name="GSocketClient-struct"></a><h3>GSocketClient</h3>
  1771. <pre class="programlisting">typedef struct _GSocketClient GSocketClient;</pre>
  1772. <p>A helper class for network clients to make connections.</p>
  1773. <p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p>
  1774. </div>
  1775. <hr>
  1776. <div class="refsect2">
  1777. <a name="GSocketClientEvent"></a><h3>enum GSocketClientEvent</h3>
  1778. <p>Describes an event occurring on a <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a>. See the
  1779. <a class="link" href="GSocketClient.html#GSocketClient-event" title="The “event” signal"><span class="type">event</span></a> signal for more details.</p>
  1780. <p>Additional values may be added to this type in the future.</p>
  1781. <div class="refsect3">
  1782. <a name="GSocketClientEvent.members"></a><h4>Members</h4>
  1783. <div class="informaltable"><table class="informaltable" width="100%" border="0">
  1784. <colgroup>
  1785. <col width="300px" class="enum_members_name">
  1786. <col class="enum_members_description">
  1787. <col width="200px" class="enum_members_annotations">
  1788. </colgroup>
  1789. <tbody>
  1790. <tr>
  1791. <td class="enum_member_name"><p><a name="G-SOCKET-CLIENT-RESOLVING:CAPS"></a>G_SOCKET_CLIENT_RESOLVING</p></td>
  1792. <td class="enum_member_description">
  1793. <p>The client is doing a DNS lookup.</p>
  1794. </td>
  1795. <td class="enum_member_annotations"> </td>
  1796. </tr>
  1797. <tr>
  1798. <td class="enum_member_name"><p><a name="G-SOCKET-CLIENT-RESOLVED:CAPS"></a>G_SOCKET_CLIENT_RESOLVED</p></td>
  1799. <td class="enum_member_description">
  1800. <p>The client has completed a DNS lookup.</p>
  1801. </td>
  1802. <td class="enum_member_annotations"> </td>
  1803. </tr>
  1804. <tr>
  1805. <td class="enum_member_name"><p><a name="G-SOCKET-CLIENT-CONNECTING:CAPS"></a>G_SOCKET_CLIENT_CONNECTING</p></td>
  1806. <td class="enum_member_description">
  1807. <p>The client is connecting to a remote
  1808. host (either a proxy or the destination server).</p>
  1809. </td>
  1810. <td class="enum_member_annotations"> </td>
  1811. </tr>
  1812. <tr>
  1813. <td class="enum_member_name"><p><a name="G-SOCKET-CLIENT-CONNECTED:CAPS"></a>G_SOCKET_CLIENT_CONNECTED</p></td>
  1814. <td class="enum_member_description">
  1815. <p>The client has connected to a remote
  1816. host.</p>
  1817. </td>
  1818. <td class="enum_member_annotations"> </td>
  1819. </tr>
  1820. <tr>
  1821. <td class="enum_member_name"><p><a name="G-SOCKET-CLIENT-PROXY-NEGOTIATING:CAPS"></a>G_SOCKET_CLIENT_PROXY_NEGOTIATING</p></td>
  1822. <td class="enum_member_description">
  1823. <p>The client is negotiating
  1824. with a proxy to connect to the destination server.</p>
  1825. </td>
  1826. <td class="enum_member_annotations"> </td>
  1827. </tr>
  1828. <tr>
  1829. <td class="enum_member_name"><p><a name="G-SOCKET-CLIENT-PROXY-NEGOTIATED:CAPS"></a>G_SOCKET_CLIENT_PROXY_NEGOTIATED</p></td>
  1830. <td class="enum_member_description">
  1831. <p>The client has negotiated
  1832. with the proxy server.</p>
  1833. </td>
  1834. <td class="enum_member_annotations"> </td>
  1835. </tr>
  1836. <tr>
  1837. <td class="enum_member_name"><p><a name="G-SOCKET-CLIENT-TLS-HANDSHAKING:CAPS"></a>G_SOCKET_CLIENT_TLS_HANDSHAKING</p></td>
  1838. <td class="enum_member_description">
  1839. <p>The client is performing a
  1840. TLS handshake.</p>
  1841. </td>
  1842. <td class="enum_member_annotations"> </td>
  1843. </tr>
  1844. <tr>
  1845. <td class="enum_member_name"><p><a name="G-SOCKET-CLIENT-TLS-HANDSHAKED:CAPS"></a>G_SOCKET_CLIENT_TLS_HANDSHAKED</p></td>
  1846. <td class="enum_member_description">
  1847. <p>The client has performed a
  1848. TLS handshake.</p>
  1849. </td>
  1850. <td class="enum_member_annotations"> </td>
  1851. </tr>
  1852. <tr>
  1853. <td class="enum_member_name"><p><a name="G-SOCKET-CLIENT-COMPLETE:CAPS"></a>G_SOCKET_CLIENT_COMPLETE</p></td>
  1854. <td class="enum_member_description">
  1855. <p>The client is done with a particular
  1856. <a class="link" href="GSocketConnectable.html" title="GSocketConnectable"><span class="type">GSocketConnectable</span></a>.</p>
  1857. </td>
  1858. <td class="enum_member_annotations"> </td>
  1859. </tr>
  1860. </tbody>
  1861. </table></div>
  1862. </div>
  1863. <p class="since">Since: <a class="link" href="api-index-2-32.html#api-index-2.32">2.32</a></p>
  1864. </div>
  1865. </div>
  1866. <div class="refsect1">
  1867. <a name="GSocketClient.property-details"></a><h2>Property Details</h2>
  1868. <div class="refsect2">
  1869. <a name="GSocketClient--enable-proxy"></a><h3>The <code class="literal">enable-proxy</code> property</h3>
  1870. <pre class="programlisting"> enable-proxy <a href="../glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></pre>
  1871. <p>Enable proxy support.</p>
  1872. <p>Flags: Read / Write / Construct</p>
  1873. <p>Default value: TRUE</p>
  1874. </div>
  1875. <hr>
  1876. <div class="refsect2">
  1877. <a name="GSocketClient--family"></a><h3>The <code class="literal">family</code> property</h3>
  1878. <pre class="programlisting"> family <a class="link" href="GSocketAddress.html#GSocketFamily" title="enum GSocketFamily"><span class="type">GSocketFamily</span></a></pre>
  1879. <p>The sockets address family to use for socket construction.</p>
  1880. <p>Flags: Read / Write / Construct</p>
  1881. <p>Default value: G_SOCKET_FAMILY_INVALID</p>
  1882. </div>
  1883. <hr>
  1884. <div class="refsect2">
  1885. <a name="GSocketClient--local-address"></a><h3>The <code class="literal">local-address</code> property</h3>
  1886. <pre class="programlisting"> local-address <a class="link" href="GSocketAddress.html" title="GSocketAddress"><span class="type">GSocketAddress</span></a> *</pre>
  1887. <p>The local address constructed sockets will be bound to.</p>
  1888. <p>Flags: Read / Write / Construct</p>
  1889. </div>
  1890. <hr>
  1891. <div class="refsect2">
  1892. <a name="GSocketClient--protocol"></a><h3>The <code class="literal">protocol</code> property</h3>
  1893. <pre class="programlisting"> protocol <a class="link" href="GSocket.html#GSocketProtocol" title="enum GSocketProtocol"><span class="type">GSocketProtocol</span></a></pre>
  1894. <p>The protocol to use for socket construction, or 0 for default.</p>
  1895. <p>Flags: Read / Write / Construct</p>
  1896. <p>Default value: G_SOCKET_PROTOCOL_DEFAULT</p>
  1897. </div>
  1898. <hr>
  1899. <div class="refsect2">
  1900. <a name="GSocketClient--proxy-resolver"></a><h3>The <code class="literal">proxy-resolver</code> property</h3>
  1901. <pre class="programlisting"> proxy-resolver <a class="link" href="GProxyResolver.html" title="GProxyResolver"><span class="type">GProxyResolver</span></a> *</pre>
  1902. <p>The proxy resolver to use</p>
  1903. <p>Flags: Read / Write / Construct</p>
  1904. <p class="since">Since: <a class="link" href="api-index-2-36.html#api-index-2.36">2.36</a></p>
  1905. </div>
  1906. <hr>
  1907. <div class="refsect2">
  1908. <a name="GSocketClient--timeout"></a><h3>The <code class="literal">timeout</code> property</h3>
  1909. <pre class="programlisting"> timeout <a href="../glib-Basic-Types.html#guint"><span class="type">guint</span></a></pre>
  1910. <p>The I/O timeout for sockets, or 0 for none.</p>
  1911. <p>Flags: Read / Write / Construct</p>
  1912. <p>Default value: 0</p>
  1913. </div>
  1914. <hr>
  1915. <div class="refsect2">
  1916. <a name="GSocketClient--tls"></a><h3>The <code class="literal">tls</code> property</h3>
  1917. <pre class="programlisting"> tls <a href="../glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></pre>
  1918. <p>Whether to create TLS connections.</p>
  1919. <p>Flags: Read / Write / Construct</p>
  1920. <p>Default value: FALSE</p>
  1921. </div>
  1922. <hr>
  1923. <div class="refsect2">
  1924. <a name="GSocketClient--tls-validation-flags"></a><h3>The <code class="literal">tls-validation-flags</code> property</h3>
  1925. <pre class="programlisting"> tls-validation-flags <a class="link" href="gio-TLS-Overview.html#GTlsCertificateFlags" title="enum GTlsCertificateFlags"><span class="type">GTlsCertificateFlags</span></a></pre>
  1926. <p>TLS validation flags to use.</p>
  1927. <p>Flags: Read / Write / Construct</p>
  1928. <p>Default value: G_TLS_CERTIFICATE_UNKNOWN_CA | G_TLS_CERTIFICATE_BAD_IDENTITY | G_TLS_CERTIFICATE_NOT_ACTIVATED | G_TLS_CERTIFICATE_EXPIRED | G_TLS_CERTIFICATE_REVOKED | G_TLS_CERTIFICATE_INSECURE | G_TLS_CERTIFICATE_GENERIC_ERROR</p>
  1929. </div>
  1930. <hr>
  1931. <div class="refsect2">
  1932. <a name="GSocketClient--type"></a><h3>The <code class="literal">type</code> property</h3>
  1933. <pre class="programlisting"> type <a class="link" href="GSocket.html#GSocketType" title="enum GSocketType"><span class="type">GSocketType</span></a></pre>
  1934. <p>The sockets type to use for socket construction.</p>
  1935. <p>Flags: Read / Write / Construct</p>
  1936. <p>Default value: G_SOCKET_TYPE_STREAM</p>
  1937. </div>
  1938. </div>
  1939. <div class="refsect1">
  1940. <a name="GSocketClient.signal-details"></a><h2>Signal Details</h2>
  1941. <div class="refsect2">
  1942. <a name="GSocketClient-event"></a><h3>The <code class="literal">event</code> signal</h3>
  1943. <pre class="programlisting"><span class="returnvalue">void</span>
  1944. user_function (<a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a> *client,
  1945. <a class="link" href="GSocketClient.html#GSocketClientEvent" title="enum GSocketClientEvent"><span class="type">GSocketClientEvent</span></a> event,
  1946. <a class="link" href="GSocketConnectable.html" title="GSocketConnectable"><span class="type">GSocketConnectable</span></a> *connectable,
  1947. <a class="link" href="GIOStream.html" title="GIOStream"><span class="type">GIOStream</span></a> *connection,
  1948. <a href="../glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data)</pre>
  1949. <p>Emitted when <em class="parameter"><code>client</code></em>
  1950. 's activity on <em class="parameter"><code>connectable</code></em>
  1951. changes state.
  1952. Among other things, this can be used to provide progress
  1953. information about a network connection in the UI. The meanings of
  1954. the different <em class="parameter"><code>event</code></em>
  1955. values are as follows:</p>
  1956. <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
  1957. <li class="listitem"><p><a class="link" href="GSocketClient.html#G-SOCKET-CLIENT-RESOLVING:CAPS"><code class="literal">G_SOCKET_CLIENT_RESOLVING</code></a>: <em class="parameter"><code>client</code></em>
  1958. is about to look up <em class="parameter"><code>connectable</code></em>
  1959. in DNS. <em class="parameter"><code>connection</code></em>
  1960. will be <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p></li>
  1961. <li class="listitem"><p><a class="link" href="GSocketClient.html#G-SOCKET-CLIENT-RESOLVED:CAPS"><code class="literal">G_SOCKET_CLIENT_RESOLVED</code></a>: <em class="parameter"><code>client</code></em>
  1962. has successfully resolved
  1963. <em class="parameter"><code>connectable</code></em>
  1964. in DNS. <em class="parameter"><code>connection</code></em>
  1965. will be <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p></li>
  1966. <li class="listitem"><p><a class="link" href="GSocketClient.html#G-SOCKET-CLIENT-CONNECTING:CAPS"><code class="literal">G_SOCKET_CLIENT_CONNECTING</code></a>: <em class="parameter"><code>client</code></em>
  1967. is about to make a connection
  1968. to a remote host; either a proxy server or the destination server
  1969. itself. <em class="parameter"><code>connection</code></em>
  1970. is the <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a>, which is not yet
  1971. connected. Since GLib 2.40, you can access the remote
  1972. address via <a class="link" href="GSocketConnection.html#g-socket-connection-get-remote-address" title="g_socket_connection_get_remote_address ()"><code class="function">g_socket_connection_get_remote_address()</code></a>.</p></li>
  1973. <li class="listitem"><p><a class="link" href="GSocketClient.html#G-SOCKET-CLIENT-CONNECTED:CAPS"><code class="literal">G_SOCKET_CLIENT_CONNECTED</code></a>: <em class="parameter"><code>client</code></em>
  1974. has successfully connected
  1975. to a remote host. <em class="parameter"><code>connection</code></em>
  1976. is the connected <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a>.</p></li>
  1977. <li class="listitem"><p><a class="link" href="GSocketClient.html#G-SOCKET-CLIENT-PROXY-NEGOTIATING:CAPS"><code class="literal">G_SOCKET_CLIENT_PROXY_NEGOTIATING</code></a>: <em class="parameter"><code>client</code></em>
  1978. is about to negotiate
  1979. with a proxy to get it to connect to <em class="parameter"><code>connectable</code></em>
  1980. . <em class="parameter"><code>connection</code></em>
  1981. is
  1982. the <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a> to the proxy server.</p></li>
  1983. <li class="listitem"><p><a class="link" href="GSocketClient.html#G-SOCKET-CLIENT-PROXY-NEGOTIATED:CAPS"><code class="literal">G_SOCKET_CLIENT_PROXY_NEGOTIATED</code></a>: <em class="parameter"><code>client</code></em>
  1984. has negotiated a
  1985. connection to <em class="parameter"><code>connectable</code></em>
  1986. through a proxy server. <em class="parameter"><code>connection</code></em>
  1987. is
  1988. the stream returned from <a class="link" href="GProxy.html#g-proxy-connect" title="g_proxy_connect ()"><code class="function">g_proxy_connect()</code></a>, which may or may not
  1989. be a <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a>.</p></li>
  1990. <li class="listitem"><p><a class="link" href="GSocketClient.html#G-SOCKET-CLIENT-TLS-HANDSHAKING:CAPS"><code class="literal">G_SOCKET_CLIENT_TLS_HANDSHAKING</code></a>: <em class="parameter"><code>client</code></em>
  1991. is about to begin a TLS
  1992. handshake. <em class="parameter"><code>connection</code></em>
  1993. is a <a class="link" href="GTlsClientConnection.html" title="GTlsClientConnection"><span class="type">GTlsClientConnection</span></a>.</p></li>
  1994. <li class="listitem"><p><a class="link" href="GSocketClient.html#G-SOCKET-CLIENT-TLS-HANDSHAKED:CAPS"><code class="literal">G_SOCKET_CLIENT_TLS_HANDSHAKED</code></a>: <em class="parameter"><code>client</code></em>
  1995. has successfully completed
  1996. the TLS handshake. <em class="parameter"><code>connection</code></em>
  1997. is a <a class="link" href="GTlsClientConnection.html" title="GTlsClientConnection"><span class="type">GTlsClientConnection</span></a>.</p></li>
  1998. <li class="listitem"><p><a class="link" href="GSocketClient.html#G-SOCKET-CLIENT-COMPLETE:CAPS"><code class="literal">G_SOCKET_CLIENT_COMPLETE</code></a>: <em class="parameter"><code>client</code></em>
  1999. has either successfully connected
  2000. to <em class="parameter"><code>connectable</code></em>
  2001. (in which case <em class="parameter"><code>connection</code></em>
  2002. is the <a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a>
  2003. that it will be returning to the caller) or has failed (in which
  2004. case <em class="parameter"><code>connection</code></em>
  2005. is <a href="../glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> and the client is about to return an error).</p></li>
  2006. </ul></div>
  2007. <p>Each event except <a class="link" href="GSocketClient.html#G-SOCKET-CLIENT-COMPLETE:CAPS"><code class="literal">G_SOCKET_CLIENT_COMPLETE</code></a> may be emitted
  2008. multiple times (or not at all) for a given connectable (in
  2009. particular, if <em class="parameter"><code>client</code></em>
  2010. ends up attempting to connect to more than
  2011. one address). However, if <em class="parameter"><code>client</code></em>
  2012. emits the <a class="link" href="GSocketClient.html#GSocketClient-event" title="The “event” signal"><span class="type">event</span></a>
  2013. signal at all for a given connectable, that it will always emit
  2014. it with <a class="link" href="GSocketClient.html#G-SOCKET-CLIENT-COMPLETE:CAPS"><code class="literal">G_SOCKET_CLIENT_COMPLETE</code></a> when it is done.</p>
  2015. <p>Note that there may be additional <a class="link" href="GSocketClient.html#GSocketClientEvent" title="enum GSocketClientEvent"><span class="type">GSocketClientEvent</span></a> values in
  2016. the future; unrecognized <em class="parameter"><code>event</code></em>
  2017. values should be ignored.</p>
  2018. <div class="refsect3">
  2019. <a name="GSocketClient-event.parameters"></a><h4>Parameters</h4>
  2020. <div class="informaltable"><table class="informaltable" width="100%" border="0">
  2021. <colgroup>
  2022. <col width="150px" class="parameters_name">
  2023. <col class="parameters_description">
  2024. <col width="200px" class="parameters_annotations">
  2025. </colgroup>
  2026. <tbody>
  2027. <tr>
  2028. <td class="parameter_name"><p>client</p></td>
  2029. <td class="parameter_description"><p>the <a class="link" href="GSocketClient.html" title="GSocketClient"><span class="type">GSocketClient</span></a></p></td>
  2030. <td class="parameter_annotations"> </td>
  2031. </tr>
  2032. <tr>
  2033. <td class="parameter_name"><p>event</p></td>
  2034. <td class="parameter_description"><p>the event that is occurring</p></td>
  2035. <td class="parameter_annotations"> </td>
  2036. </tr>
  2037. <tr>
  2038. <td class="parameter_name"><p>connectable</p></td>
  2039. <td class="parameter_description"><p>the <a class="link" href="GSocketConnectable.html" title="GSocketConnectable"><span class="type">GSocketConnectable</span></a> that <em class="parameter"><code>event</code></em>
  2040. is occurring on</p></td>
  2041. <td class="parameter_annotations"> </td>
  2042. </tr>
  2043. <tr>
  2044. <td class="parameter_name"><p>connection</p></td>
  2045. <td class="parameter_description"><p> the current representation of the connection. </p></td>
  2046. <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
  2047. </tr>
  2048. <tr>
  2049. <td class="parameter_name"><p>user_data</p></td>
  2050. <td class="parameter_description"><p>user data set when the signal handler was connected.</p></td>
  2051. <td class="parameter_annotations"> </td>
  2052. </tr>
  2053. </tbody>
  2054. </table></div>
  2055. </div>
  2056. <p>Flags: <a href="../gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS">Run Last</a></p>
  2057. <p class="since">Since: <a class="link" href="api-index-2-32.html#api-index-2.32">2.32</a></p>
  2058. </div>
  2059. </div>
  2060. <div class="refsect1">
  2061. <a name="GSocketClient.see-also"></a><h2>See Also</h2>
  2062. <p><a class="link" href="GSocketConnection.html" title="GSocketConnection"><span class="type">GSocketConnection</span></a>, <a class="link" href="GSocketListener.html" title="GSocketListener"><span class="type">GSocketListener</span></a></p>
  2063. </div>
  2064. </div>
  2065. <div class="footer">
  2066. <hr>Generated by GTK-Doc V1.25.1</div>
  2067. </body>
  2068. </html>