@chilkat/react-native 11.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (530) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/ChilkatRN.podspec +44 -0
  3. package/LICENSE +254 -0
  4. package/README.md +67 -0
  5. package/android/CMakeLists.txt +60 -0
  6. package/android/build.gradle +148 -0
  7. package/android/gradle.properties +5 -0
  8. package/android/src/main/AndroidManifest.xml +2 -0
  9. package/android/src/main/cpp/cpp-adapter.cpp +12 -0
  10. package/android/src/main/java/com/margelo/nitro/chilkat/ChilkatRNPackage.java +33 -0
  11. package/chilkat-checksums.json +9 -0
  12. package/cpp/HybridAi.cpp +660 -0
  13. package/cpp/HybridAi.hpp +159 -0
  14. package/cpp/HybridAsn.cpp +403 -0
  15. package/cpp/HybridAsn.hpp +105 -0
  16. package/cpp/HybridAuthAws.cpp +188 -0
  17. package/cpp/HybridAuthAws.hpp +55 -0
  18. package/cpp/HybridAuthAzureSAS.cpp +142 -0
  19. package/cpp/HybridAuthAzureSAS.hpp +47 -0
  20. package/cpp/HybridAuthAzureStorage.cpp +144 -0
  21. package/cpp/HybridAuthAzureStorage.hpp +47 -0
  22. package/cpp/HybridAuthGoogle.cpp +215 -0
  23. package/cpp/HybridAuthGoogle.hpp +67 -0
  24. package/cpp/HybridBinData.cpp +439 -0
  25. package/cpp/HybridBinData.hpp +112 -0
  26. package/cpp/HybridBz2.cpp +177 -0
  27. package/cpp/HybridBz2.hpp +58 -0
  28. package/cpp/HybridCache.cpp +314 -0
  29. package/cpp/HybridCache.hpp +82 -0
  30. package/cpp/HybridCert.cpp +840 -0
  31. package/cpp/HybridCert.hpp +196 -0
  32. package/cpp/HybridCertChain.cpp +149 -0
  33. package/cpp/HybridCertChain.hpp +50 -0
  34. package/cpp/HybridCertStore.cpp +276 -0
  35. package/cpp/HybridCertStore.hpp +78 -0
  36. package/cpp/HybridCharset.cpp +333 -0
  37. package/cpp/HybridCharset.hpp +83 -0
  38. package/cpp/HybridCkDateTime.cpp +384 -0
  39. package/cpp/HybridCkDateTime.hpp +105 -0
  40. package/cpp/HybridCodeSign.cpp +156 -0
  41. package/cpp/HybridCodeSign.hpp +55 -0
  42. package/cpp/HybridCompression.cpp +422 -0
  43. package/cpp/HybridCompression.hpp +100 -0
  44. package/cpp/HybridCrypt2.cpp +1517 -0
  45. package/cpp/HybridCrypt2.hpp +320 -0
  46. package/cpp/HybridCsr.cpp +292 -0
  47. package/cpp/HybridCsr.hpp +77 -0
  48. package/cpp/HybridCsv.cpp +382 -0
  49. package/cpp/HybridCsv.hpp +101 -0
  50. package/cpp/HybridDh.cpp +137 -0
  51. package/cpp/HybridDh.hpp +47 -0
  52. package/cpp/HybridDirTree.cpp +167 -0
  53. package/cpp/HybridDirTree.hpp +53 -0
  54. package/cpp/HybridDkim.cpp +249 -0
  55. package/cpp/HybridDkim.hpp +74 -0
  56. package/cpp/HybridDns.cpp +193 -0
  57. package/cpp/HybridDns.hpp +64 -0
  58. package/cpp/HybridDsa.cpp +453 -0
  59. package/cpp/HybridDsa.hpp +112 -0
  60. package/cpp/HybridDtObj.cpp +172 -0
  61. package/cpp/HybridDtObj.hpp +57 -0
  62. package/cpp/HybridEcc.cpp +195 -0
  63. package/cpp/HybridEcc.hpp +55 -0
  64. package/cpp/HybridEdDSA.cpp +147 -0
  65. package/cpp/HybridEdDSA.hpp +47 -0
  66. package/cpp/HybridEmail.cpp +1911 -0
  67. package/cpp/HybridEmail.hpp +419 -0
  68. package/cpp/HybridEmailBundle.cpp +204 -0
  69. package/cpp/HybridEmailBundle.hpp +64 -0
  70. package/cpp/HybridFileAccess.cpp +631 -0
  71. package/cpp/HybridFileAccess.hpp +149 -0
  72. package/cpp/HybridFtp2.cpp +2308 -0
  73. package/cpp/HybridFtp2.hpp +462 -0
  74. package/cpp/HybridGlobal.cpp +221 -0
  75. package/cpp/HybridGlobal.hpp +68 -0
  76. package/cpp/HybridGzip.cpp +440 -0
  77. package/cpp/HybridGzip.hpp +105 -0
  78. package/cpp/HybridHashtable.cpp +211 -0
  79. package/cpp/HybridHashtable.hpp +64 -0
  80. package/cpp/HybridHtmlToText.cpp +136 -0
  81. package/cpp/HybridHtmlToText.hpp +47 -0
  82. package/cpp/HybridHtmlToXml.cpp +218 -0
  83. package/cpp/HybridHtmlToXml.hpp +65 -0
  84. package/cpp/HybridHttp.cpp +2067 -0
  85. package/cpp/HybridHttp.hpp +416 -0
  86. package/cpp/HybridHttpCurl.cpp +337 -0
  87. package/cpp/HybridHttpCurl.hpp +93 -0
  88. package/cpp/HybridHttpRequest.cpp +455 -0
  89. package/cpp/HybridHttpRequest.hpp +109 -0
  90. package/cpp/HybridHttpResponse.cpp +340 -0
  91. package/cpp/HybridHttpResponse.hpp +86 -0
  92. package/cpp/HybridImap.cpp +1818 -0
  93. package/cpp/HybridImap.hpp +363 -0
  94. package/cpp/HybridJavaKeyStore.cpp +387 -0
  95. package/cpp/HybridJavaKeyStore.hpp +98 -0
  96. package/cpp/HybridJs.cpp +154 -0
  97. package/cpp/HybridJs.hpp +54 -0
  98. package/cpp/HybridJsonArray.cpp +441 -0
  99. package/cpp/HybridJsonArray.hpp +120 -0
  100. package/cpp/HybridJsonObject.cpp +1125 -0
  101. package/cpp/HybridJsonObject.hpp +260 -0
  102. package/cpp/HybridJwe.cpp +294 -0
  103. package/cpp/HybridJwe.hpp +82 -0
  104. package/cpp/HybridJws.cpp +290 -0
  105. package/cpp/HybridJws.hpp +82 -0
  106. package/cpp/HybridJwt.cpp +198 -0
  107. package/cpp/HybridJwt.hpp +57 -0
  108. package/cpp/HybridLog.cpp +212 -0
  109. package/cpp/HybridLog.hpp +63 -0
  110. package/cpp/HybridMailMan.cpp +1853 -0
  111. package/cpp/HybridMailMan.hpp +386 -0
  112. package/cpp/HybridMailboxes.cpp +165 -0
  113. package/cpp/HybridMailboxes.hpp +54 -0
  114. package/cpp/HybridMcp.cpp +322 -0
  115. package/cpp/HybridMcp.hpp +85 -0
  116. package/cpp/HybridMessageSet.cpp +162 -0
  117. package/cpp/HybridMessageSet.hpp +54 -0
  118. package/cpp/HybridMht.cpp +700 -0
  119. package/cpp/HybridMht.hpp +165 -0
  120. package/cpp/HybridMime.cpp +1119 -0
  121. package/cpp/HybridMime.hpp +266 -0
  122. package/cpp/HybridNtlm.cpp +333 -0
  123. package/cpp/HybridNtlm.hpp +83 -0
  124. package/cpp/HybridOAuth1.cpp +307 -0
  125. package/cpp/HybridOAuth1.hpp +78 -0
  126. package/cpp/HybridOAuth2.cpp +515 -0
  127. package/cpp/HybridOAuth2.hpp +127 -0
  128. package/cpp/HybridPdf.cpp +370 -0
  129. package/cpp/HybridPdf.hpp +103 -0
  130. package/cpp/HybridPem.cpp +327 -0
  131. package/cpp/HybridPem.hpp +88 -0
  132. package/cpp/HybridPfx.cpp +343 -0
  133. package/cpp/HybridPfx.hpp +87 -0
  134. package/cpp/HybridPkcs11.cpp +318 -0
  135. package/cpp/HybridPkcs11.hpp +88 -0
  136. package/cpp/HybridPrivateKey.cpp +464 -0
  137. package/cpp/HybridPrivateKey.hpp +117 -0
  138. package/cpp/HybridPrng.cpp +192 -0
  139. package/cpp/HybridPrng.hpp +57 -0
  140. package/cpp/HybridPublicKey.cpp +238 -0
  141. package/cpp/HybridPublicKey.hpp +68 -0
  142. package/cpp/HybridRest.cpp +993 -0
  143. package/cpp/HybridRest.hpp +214 -0
  144. package/cpp/HybridRsa.cpp +348 -0
  145. package/cpp/HybridRsa.hpp +90 -0
  146. package/cpp/HybridSCard.cpp +328 -0
  147. package/cpp/HybridSCard.hpp +91 -0
  148. package/cpp/HybridSFtp.cpp +1889 -0
  149. package/cpp/HybridSFtp.hpp +366 -0
  150. package/cpp/HybridSFtpDir.cpp +119 -0
  151. package/cpp/HybridSFtpDir.hpp +43 -0
  152. package/cpp/HybridSFtpFile.cpp +203 -0
  153. package/cpp/HybridSFtpFile.hpp +60 -0
  154. package/cpp/HybridScMinidriver.cpp +341 -0
  155. package/cpp/HybridScMinidriver.hpp +88 -0
  156. package/cpp/HybridScp.cpp +398 -0
  157. package/cpp/HybridScp.hpp +96 -0
  158. package/cpp/HybridSecrets.cpp +328 -0
  159. package/cpp/HybridSecrets.hpp +84 -0
  160. package/cpp/HybridSecureString.cpp +175 -0
  161. package/cpp/HybridSecureString.hpp +55 -0
  162. package/cpp/HybridServerSentEvent.cpp +112 -0
  163. package/cpp/HybridServerSentEvent.hpp +41 -0
  164. package/cpp/HybridSocket.cpp +1567 -0
  165. package/cpp/HybridSocket.hpp +336 -0
  166. package/cpp/HybridSpider.cpp +543 -0
  167. package/cpp/HybridSpider.hpp +138 -0
  168. package/cpp/HybridSsh.cpp +1330 -0
  169. package/cpp/HybridSsh.hpp +282 -0
  170. package/cpp/HybridSshKey.cpp +310 -0
  171. package/cpp/HybridSshKey.hpp +83 -0
  172. package/cpp/HybridSshTunnel.cpp +687 -0
  173. package/cpp/HybridSshTunnel.hpp +159 -0
  174. package/cpp/HybridStream.cpp +496 -0
  175. package/cpp/HybridStream.hpp +123 -0
  176. package/cpp/HybridStringArray.cpp +368 -0
  177. package/cpp/HybridStringArray.hpp +99 -0
  178. package/cpp/HybridStringBuilder.cpp +739 -0
  179. package/cpp/HybridStringBuilder.hpp +178 -0
  180. package/cpp/HybridStringTable.cpp +218 -0
  181. package/cpp/HybridStringTable.hpp +66 -0
  182. package/cpp/HybridTar.cpp +547 -0
  183. package/cpp/HybridTar.hpp +134 -0
  184. package/cpp/HybridTrustedRoots.cpp +178 -0
  185. package/cpp/HybridTrustedRoots.hpp +61 -0
  186. package/cpp/HybridUnixCompress.cpp +191 -0
  187. package/cpp/HybridUnixCompress.hpp +60 -0
  188. package/cpp/HybridUpload.cpp +427 -0
  189. package/cpp/HybridUpload.hpp +114 -0
  190. package/cpp/HybridUrl.cpp +152 -0
  191. package/cpp/HybridUrl.hpp +48 -0
  192. package/cpp/HybridWebSocket.cpp +378 -0
  193. package/cpp/HybridWebSocket.hpp +103 -0
  194. package/cpp/HybridXml.cpp +1527 -0
  195. package/cpp/HybridXml.hpp +340 -0
  196. package/cpp/HybridXmlCertVault.cpp +215 -0
  197. package/cpp/HybridXmlCertVault.hpp +63 -0
  198. package/cpp/HybridXmlDSig.cpp +328 -0
  199. package/cpp/HybridXmlDSig.hpp +88 -0
  200. package/cpp/HybridXmlDSigGen.cpp +549 -0
  201. package/cpp/HybridXmlDSigGen.hpp +126 -0
  202. package/cpp/HybridXmp.cpp +329 -0
  203. package/cpp/HybridXmp.hpp +86 -0
  204. package/cpp/HybridZip.cpp +1000 -0
  205. package/cpp/HybridZip.hpp +226 -0
  206. package/cpp/HybridZipCrc.cpp +162 -0
  207. package/cpp/HybridZipCrc.hpp +57 -0
  208. package/cpp/HybridZipEntry.cpp +395 -0
  209. package/cpp/HybridZipEntry.hpp +102 -0
  210. package/cpp/runtime/AsyncCall.hpp +96 -0
  211. package/cpp/runtime/Bytes.hpp +49 -0
  212. package/cpp/runtime/ChilkatError.hpp +66 -0
  213. package/cpp/runtime/ChilkatObject.hpp +219 -0
  214. package/cpp/runtime/ProgLang.hpp +9 -0
  215. package/cpp/runtime/ProgressAdapter.hpp +43 -0
  216. package/nitro.json +113 -0
  217. package/nitrogen/generated/.gitattributes +1 -0
  218. package/nitrogen/generated/android/ChilkatRN+autolinking.cmake +179 -0
  219. package/nitrogen/generated/android/ChilkatRN+autolinking.gradle +27 -0
  220. package/nitrogen/generated/android/ChilkatRNOnLoad.cpp +1029 -0
  221. package/nitrogen/generated/android/ChilkatRNOnLoad.hpp +34 -0
  222. package/nitrogen/generated/android/kotlin/com/margelo/nitro/chilkat/ChilkatRNOnLoad.kt +35 -0
  223. package/nitrogen/generated/ios/ChilkatRN+autolinking.rb +62 -0
  224. package/nitrogen/generated/ios/ChilkatRN-Swift-Cxx-Bridge.cpp +17 -0
  225. package/nitrogen/generated/ios/ChilkatRN-Swift-Cxx-Bridge.hpp +27 -0
  226. package/nitrogen/generated/ios/ChilkatRN-Swift-Cxx-Umbrella.hpp +38 -0
  227. package/nitrogen/generated/ios/ChilkatRNAutolinking.mm +1015 -0
  228. package/nitrogen/generated/ios/ChilkatRNAutolinking.swift +16 -0
  229. package/nitrogen/generated/shared/c++/HybridAiSpec.cpp +114 -0
  230. package/nitrogen/generated/shared/c++/HybridAiSpec.hpp +175 -0
  231. package/nitrogen/generated/shared/c++/HybridAsnSpec.cpp +70 -0
  232. package/nitrogen/generated/shared/c++/HybridAsnSpec.hpp +116 -0
  233. package/nitrogen/generated/shared/c++/HybridAuthAwsSpec.cpp +49 -0
  234. package/nitrogen/generated/shared/c++/HybridAuthAwsSpec.hpp +89 -0
  235. package/nitrogen/generated/shared/c++/HybridAuthAzureSASSpec.cpp +38 -0
  236. package/nitrogen/generated/shared/c++/HybridAuthAzureSASSpec.hpp +78 -0
  237. package/nitrogen/generated/shared/c++/HybridAuthAzureStorageSpec.cpp +41 -0
  238. package/nitrogen/generated/shared/c++/HybridAuthAzureStorageSpec.hpp +81 -0
  239. package/nitrogen/generated/shared/c++/HybridAuthGoogleSpec.cpp +56 -0
  240. package/nitrogen/generated/shared/c++/HybridAuthGoogleSpec.hpp +108 -0
  241. package/nitrogen/generated/shared/c++/HybridBinDataSpec.cpp +69 -0
  242. package/nitrogen/generated/shared/c++/HybridBinDataSpec.hpp +116 -0
  243. package/nitrogen/generated/shared/c++/HybridBz2Spec.cpp +47 -0
  244. package/nitrogen/generated/shared/c++/HybridBz2Spec.hpp +93 -0
  245. package/nitrogen/generated/shared/c++/HybridCacheSpec.cpp +57 -0
  246. package/nitrogen/generated/shared/c++/HybridCacheSpec.hpp +106 -0
  247. package/nitrogen/generated/shared/c++/HybridCertChainSpec.cpp +40 -0
  248. package/nitrogen/generated/shared/c++/HybridCertChainSpec.hpp +89 -0
  249. package/nitrogen/generated/shared/c++/HybridCertSpec.cpp +138 -0
  250. package/nitrogen/generated/shared/c++/HybridCertSpec.hpp +205 -0
  251. package/nitrogen/generated/shared/c++/HybridCertStoreSpec.cpp +55 -0
  252. package/nitrogen/generated/shared/c++/HybridCertStoreSpec.hpp +104 -0
  253. package/nitrogen/generated/shared/c++/HybridCharsetSpec.cpp +61 -0
  254. package/nitrogen/generated/shared/c++/HybridCharsetSpec.hpp +101 -0
  255. package/nitrogen/generated/shared/c++/HybridCkDateTimeSpec.cpp +66 -0
  256. package/nitrogen/generated/shared/c++/HybridCkDateTimeSpec.hpp +115 -0
  257. package/nitrogen/generated/shared/c++/HybridCodeSignSpec.cpp +44 -0
  258. package/nitrogen/generated/shared/c++/HybridCodeSignSpec.hpp +93 -0
  259. package/nitrogen/generated/shared/c++/HybridCompressionSpec.cpp +79 -0
  260. package/nitrogen/generated/shared/c++/HybridCompressionSpec.hpp +134 -0
  261. package/nitrogen/generated/shared/c++/HybridCrypt2Spec.cpp +215 -0
  262. package/nitrogen/generated/shared/c++/HybridCrypt2Spec.hpp +283 -0
  263. package/nitrogen/generated/shared/c++/HybridCsrSpec.cpp +61 -0
  264. package/nitrogen/generated/shared/c++/HybridCsrSpec.hpp +116 -0
  265. package/nitrogen/generated/shared/c++/HybridCsvSpec.cpp +72 -0
  266. package/nitrogen/generated/shared/c++/HybridCsvSpec.hpp +121 -0
  267. package/nitrogen/generated/shared/c++/HybridDhSpec.cpp +37 -0
  268. package/nitrogen/generated/shared/c++/HybridDhSpec.hpp +77 -0
  269. package/nitrogen/generated/shared/c++/HybridDirTreeSpec.cpp +46 -0
  270. package/nitrogen/generated/shared/c++/HybridDirTreeSpec.hpp +86 -0
  271. package/nitrogen/generated/shared/c++/HybridDkimSpec.cpp +60 -0
  272. package/nitrogen/generated/shared/c++/HybridDkimSpec.hpp +109 -0
  273. package/nitrogen/generated/shared/c++/HybridDnsSpec.cpp +51 -0
  274. package/nitrogen/generated/shared/c++/HybridDnsSpec.hpp +97 -0
  275. package/nitrogen/generated/shared/c++/HybridDsaSpec.cpp +73 -0
  276. package/nitrogen/generated/shared/c++/HybridDsaSpec.hpp +116 -0
  277. package/nitrogen/generated/shared/c++/HybridDtObjSpec.cpp +50 -0
  278. package/nitrogen/generated/shared/c++/HybridDtObjSpec.hpp +90 -0
  279. package/nitrogen/generated/shared/c++/HybridEccSpec.cpp +41 -0
  280. package/nitrogen/generated/shared/c++/HybridEccSpec.hpp +96 -0
  281. package/nitrogen/generated/shared/c++/HybridEdDSASpec.cpp +38 -0
  282. package/nitrogen/generated/shared/c++/HybridEdDSASpec.hpp +90 -0
  283. package/nitrogen/generated/shared/c++/HybridEmailBundleSpec.cpp +45 -0
  284. package/nitrogen/generated/shared/c++/HybridEmailBundleSpec.hpp +91 -0
  285. package/nitrogen/generated/shared/c++/HybridEmailSpec.cpp +259 -0
  286. package/nitrogen/generated/shared/c++/HybridEmailSpec.hpp +326 -0
  287. package/nitrogen/generated/shared/c++/HybridFileAccessSpec.cpp +90 -0
  288. package/nitrogen/generated/shared/c++/HybridFileAccessSpec.hpp +140 -0
  289. package/nitrogen/generated/shared/c++/HybridFtp2Spec.cpp +367 -0
  290. package/nitrogen/generated/shared/c++/HybridFtp2Spec.hpp +434 -0
  291. package/nitrogen/generated/shared/c++/HybridGlobalSpec.cpp +59 -0
  292. package/nitrogen/generated/shared/c++/HybridGlobalSpec.hpp +99 -0
  293. package/nitrogen/generated/shared/c++/HybridGzipSpec.cpp +79 -0
  294. package/nitrogen/generated/shared/c++/HybridGzipSpec.hpp +134 -0
  295. package/nitrogen/generated/shared/c++/HybridHashtableSpec.cpp +45 -0
  296. package/nitrogen/generated/shared/c++/HybridHashtableSpec.hpp +91 -0
  297. package/nitrogen/generated/shared/c++/HybridHtmlToTextSpec.cpp +40 -0
  298. package/nitrogen/generated/shared/c++/HybridHtmlToTextSpec.hpp +83 -0
  299. package/nitrogen/generated/shared/c++/HybridHtmlToXmlSpec.cpp +49 -0
  300. package/nitrogen/generated/shared/c++/HybridHtmlToXmlSpec.hpp +95 -0
  301. package/nitrogen/generated/shared/c++/HybridHttpCurlSpec.cpp +67 -0
  302. package/nitrogen/generated/shared/c++/HybridHttpCurlSpec.hpp +125 -0
  303. package/nitrogen/generated/shared/c++/HybridHttpRequestSpec.cpp +76 -0
  304. package/nitrogen/generated/shared/c++/HybridHttpRequestSpec.hpp +122 -0
  305. package/nitrogen/generated/shared/c++/HybridHttpResponseSpec.cpp +64 -0
  306. package/nitrogen/generated/shared/c++/HybridHttpResponseSpec.hpp +119 -0
  307. package/nitrogen/generated/shared/c++/HybridHttpSpec.cpp +334 -0
  308. package/nitrogen/generated/shared/c++/HybridHttpSpec.hpp +407 -0
  309. package/nitrogen/generated/shared/c++/HybridImapSpec.cpp +275 -0
  310. package/nitrogen/generated/shared/c++/HybridImapSpec.hpp +360 -0
  311. package/nitrogen/generated/shared/c++/HybridJavaKeyStoreSpec.cpp +65 -0
  312. package/nitrogen/generated/shared/c++/HybridJavaKeyStoreSpec.hpp +132 -0
  313. package/nitrogen/generated/shared/c++/HybridJsSpec.cpp +43 -0
  314. package/nitrogen/generated/shared/c++/HybridJsSpec.hpp +92 -0
  315. package/nitrogen/generated/shared/c++/HybridJsonArraySpec.cpp +76 -0
  316. package/nitrogen/generated/shared/c++/HybridJsonArraySpec.hpp +131 -0
  317. package/nitrogen/generated/shared/c++/HybridJsonObjectSpec.cpp +154 -0
  318. package/nitrogen/generated/shared/c++/HybridJsonObjectSpec.hpp +218 -0
  319. package/nitrogen/generated/shared/c++/HybridJweSpec.cpp +57 -0
  320. package/nitrogen/generated/shared/c++/HybridJweSpec.hpp +112 -0
  321. package/nitrogen/generated/shared/c++/HybridJwsSpec.cpp +57 -0
  322. package/nitrogen/generated/shared/c++/HybridJwsSpec.hpp +115 -0
  323. package/nitrogen/generated/shared/c++/HybridJwtSpec.cpp +43 -0
  324. package/nitrogen/generated/shared/c++/HybridJwtSpec.hpp +92 -0
  325. package/nitrogen/generated/shared/c++/HybridLogSpec.cpp +44 -0
  326. package/nitrogen/generated/shared/c++/HybridLogSpec.hpp +85 -0
  327. package/nitrogen/generated/shared/c++/HybridMailManSpec.cpp +311 -0
  328. package/nitrogen/generated/shared/c++/HybridMailManSpec.hpp +396 -0
  329. package/nitrogen/generated/shared/c++/HybridMailboxesSpec.cpp +40 -0
  330. package/nitrogen/generated/shared/c++/HybridMailboxesSpec.hpp +80 -0
  331. package/nitrogen/generated/shared/c++/HybridMcpSpec.cpp +68 -0
  332. package/nitrogen/generated/shared/c++/HybridMcpSpec.hpp +117 -0
  333. package/nitrogen/generated/shared/c++/HybridMessageSetSpec.cpp +41 -0
  334. package/nitrogen/generated/shared/c++/HybridMessageSetSpec.hpp +84 -0
  335. package/nitrogen/generated/shared/c++/HybridMhtSpec.cpp +138 -0
  336. package/nitrogen/generated/shared/c++/HybridMhtSpec.hpp +181 -0
  337. package/nitrogen/generated/shared/c++/HybridMimeSpec.cpp +169 -0
  338. package/nitrogen/generated/shared/c++/HybridMimeSpec.hpp +233 -0
  339. package/nitrogen/generated/shared/c++/HybridNtlmSpec.cpp +69 -0
  340. package/nitrogen/generated/shared/c++/HybridNtlmSpec.hpp +109 -0
  341. package/nitrogen/generated/shared/c++/HybridOAuth1Spec.cpp +67 -0
  342. package/nitrogen/generated/shared/c++/HybridOAuth1Spec.hpp +110 -0
  343. package/nitrogen/generated/shared/c++/HybridOAuth2Spec.cpp +107 -0
  344. package/nitrogen/generated/shared/c++/HybridOAuth2Spec.hpp +156 -0
  345. package/nitrogen/generated/shared/c++/HybridPdfSpec.cpp +73 -0
  346. package/nitrogen/generated/shared/c++/HybridPdfSpec.hpp +134 -0
  347. package/nitrogen/generated/shared/c++/HybridPemSpec.cpp +63 -0
  348. package/nitrogen/generated/shared/c++/HybridPemSpec.hpp +124 -0
  349. package/nitrogen/generated/shared/c++/HybridPfxSpec.cpp +61 -0
  350. package/nitrogen/generated/shared/c++/HybridPfxSpec.hpp +122 -0
  351. package/nitrogen/generated/shared/c++/HybridPkcs11Spec.cpp +60 -0
  352. package/nitrogen/generated/shared/c++/HybridPkcs11Spec.hpp +115 -0
  353. package/nitrogen/generated/shared/c++/HybridPrivateKeySpec.cpp +76 -0
  354. package/nitrogen/generated/shared/c++/HybridPrivateKeySpec.hpp +131 -0
  355. package/nitrogen/generated/shared/c++/HybridPrngSpec.cpp +42 -0
  356. package/nitrogen/generated/shared/c++/HybridPrngSpec.hpp +85 -0
  357. package/nitrogen/generated/shared/c++/HybridPublicKeySpec.cpp +48 -0
  358. package/nitrogen/generated/shared/c++/HybridPublicKeySpec.hpp +91 -0
  359. package/nitrogen/generated/shared/c++/HybridRestSpec.cpp +150 -0
  360. package/nitrogen/generated/shared/c++/HybridRestSpec.hpp +229 -0
  361. package/nitrogen/generated/shared/c++/HybridRsaSpec.cpp +68 -0
  362. package/nitrogen/generated/shared/c++/HybridRsaSpec.hpp +120 -0
  363. package/nitrogen/generated/shared/c++/HybridSCardSpec.cpp +64 -0
  364. package/nitrogen/generated/shared/c++/HybridSCardSpec.hpp +116 -0
  365. package/nitrogen/generated/shared/c++/HybridSFtpDirSpec.cpp +35 -0
  366. package/nitrogen/generated/shared/c++/HybridSFtpDirSpec.hpp +78 -0
  367. package/nitrogen/generated/shared/c++/HybridSFtpFileSpec.cpp +57 -0
  368. package/nitrogen/generated/shared/c++/HybridSFtpFileSpec.hpp +98 -0
  369. package/nitrogen/generated/shared/c++/HybridSFtpSpec.cpp +284 -0
  370. package/nitrogen/generated/shared/c++/HybridSFtpSpec.hpp +354 -0
  371. package/nitrogen/generated/shared/c++/HybridScMinidriverSpec.cpp +61 -0
  372. package/nitrogen/generated/shared/c++/HybridScMinidriverSpec.hpp +119 -0
  373. package/nitrogen/generated/shared/c++/HybridScpSpec.cpp +78 -0
  374. package/nitrogen/generated/shared/c++/HybridScpSpec.hpp +127 -0
  375. package/nitrogen/generated/shared/c++/HybridSecretsSpec.cpp +65 -0
  376. package/nitrogen/generated/shared/c++/HybridSecretsSpec.hpp +120 -0
  377. package/nitrogen/generated/shared/c++/HybridSecureStringSpec.cpp +42 -0
  378. package/nitrogen/generated/shared/c++/HybridSecureStringSpec.hpp +88 -0
  379. package/nitrogen/generated/shared/c++/HybridServerSentEventSpec.cpp +35 -0
  380. package/nitrogen/generated/shared/c++/HybridServerSentEventSpec.hpp +75 -0
  381. package/nitrogen/generated/shared/c++/HybridSocketSpec.cpp +262 -0
  382. package/nitrogen/generated/shared/c++/HybridSocketSpec.hpp +327 -0
  383. package/nitrogen/generated/shared/c++/HybridSpiderSpec.cpp +110 -0
  384. package/nitrogen/generated/shared/c++/HybridSpiderSpec.hpp +153 -0
  385. package/nitrogen/generated/shared/c++/HybridSshKeySpec.cpp +59 -0
  386. package/nitrogen/generated/shared/c++/HybridSshKeySpec.hpp +102 -0
  387. package/nitrogen/generated/shared/c++/HybridSshSpec.cpp +215 -0
  388. package/nitrogen/generated/shared/c++/HybridSshSpec.hpp +276 -0
  389. package/nitrogen/generated/shared/c++/HybridSshTunnelSpec.cpp +136 -0
  390. package/nitrogen/generated/shared/c++/HybridSshTunnelSpec.hpp +191 -0
  391. package/nitrogen/generated/shared/c++/HybridStreamSpec.cpp +100 -0
  392. package/nitrogen/generated/shared/c++/HybridStreamSpec.hpp +150 -0
  393. package/nitrogen/generated/shared/c++/HybridStringArraySpec.cpp +66 -0
  394. package/nitrogen/generated/shared/c++/HybridStringArraySpec.hpp +109 -0
  395. package/nitrogen/generated/shared/c++/HybridStringBuilderSpec.cpp +104 -0
  396. package/nitrogen/generated/shared/c++/HybridStringBuilderSpec.hpp +156 -0
  397. package/nitrogen/generated/shared/c++/HybridStringTableSpec.cpp +46 -0
  398. package/nitrogen/generated/shared/c++/HybridStringTableSpec.hpp +89 -0
  399. package/nitrogen/generated/shared/c++/HybridTarSpec.cpp +110 -0
  400. package/nitrogen/generated/shared/c++/HybridTarSpec.hpp +156 -0
  401. package/nitrogen/generated/shared/c++/HybridTrustedRootsSpec.cpp +48 -0
  402. package/nitrogen/generated/shared/c++/HybridTrustedRootsSpec.hpp +97 -0
  403. package/nitrogen/generated/shared/c++/HybridUnixCompressSpec.cpp +48 -0
  404. package/nitrogen/generated/shared/c++/HybridUnixCompressSpec.hpp +91 -0
  405. package/nitrogen/generated/shared/c++/HybridUploadSpec.cpp +98 -0
  406. package/nitrogen/generated/shared/c++/HybridUploadSpec.hpp +141 -0
  407. package/nitrogen/generated/shared/c++/HybridUrlSpec.cpp +42 -0
  408. package/nitrogen/generated/shared/c++/HybridUrlSpec.hpp +82 -0
  409. package/nitrogen/generated/shared/c++/HybridWebSocketSpec.cpp +80 -0
  410. package/nitrogen/generated/shared/c++/HybridWebSocketSpec.hpp +135 -0
  411. package/nitrogen/generated/shared/c++/HybridXmlCertVaultSpec.cpp +45 -0
  412. package/nitrogen/generated/shared/c++/HybridXmlCertVaultSpec.hpp +94 -0
  413. package/nitrogen/generated/shared/c++/HybridXmlDSigGenSpec.cpp +99 -0
  414. package/nitrogen/generated/shared/c++/HybridXmlDSigGenSpec.hpp +163 -0
  415. package/nitrogen/generated/shared/c++/HybridXmlDSigSpec.cpp +62 -0
  416. package/nitrogen/generated/shared/c++/HybridXmlDSigSpec.hpp +126 -0
  417. package/nitrogen/generated/shared/c++/HybridXmlSpec.cpp +203 -0
  418. package/nitrogen/generated/shared/c++/HybridXmlSpec.hpp +253 -0
  419. package/nitrogen/generated/shared/c++/HybridXmpSpec.cpp +58 -0
  420. package/nitrogen/generated/shared/c++/HybridXmpSpec.hpp +104 -0
  421. package/nitrogen/generated/shared/c++/HybridZipCrcSpec.cpp +43 -0
  422. package/nitrogen/generated/shared/c++/HybridZipCrcSpec.hpp +92 -0
  423. package/nitrogen/generated/shared/c++/HybridZipEntrySpec.cpp +82 -0
  424. package/nitrogen/generated/shared/c++/HybridZipEntrySpec.hpp +137 -0
  425. package/nitrogen/generated/shared/c++/HybridZipSpec.cpp +176 -0
  426. package/nitrogen/generated/shared/c++/HybridZipSpec.hpp +231 -0
  427. package/package.json +46 -0
  428. package/react-native.config.js +9 -0
  429. package/scripts/fetch-chilkat.js +184 -0
  430. package/src/index.ts +306 -0
  431. package/src/runtime/chilkat.ts +25 -0
  432. package/src/specs/Ai.nitro.ts +1288 -0
  433. package/src/specs/Asn.nitro.ts +509 -0
  434. package/src/specs/AuthAws.nitro.ts +234 -0
  435. package/src/specs/AuthAzureSAS.nitro.ts +205 -0
  436. package/src/specs/AuthAzureStorage.nitro.ts +172 -0
  437. package/src/specs/AuthGoogle.nitro.ts +291 -0
  438. package/src/specs/BinData.nitro.ts +470 -0
  439. package/src/specs/Bz2.nitro.ts +269 -0
  440. package/src/specs/Cache.nitro.ts +483 -0
  441. package/src/specs/Cert.nitro.ts +1279 -0
  442. package/src/specs/CertChain.nitro.ts +312 -0
  443. package/src/specs/CertStore.nitro.ts +430 -0
  444. package/src/specs/Charset.nitro.ts +518 -0
  445. package/src/specs/CkDateTime.nitro.ts +492 -0
  446. package/src/specs/CodeSign.nitro.ts +307 -0
  447. package/src/specs/Compression.nitro.ts +654 -0
  448. package/src/specs/Crypt2.nitro.ts +2387 -0
  449. package/src/specs/Csr.nitro.ts +461 -0
  450. package/src/specs/Csv.nitro.ts +670 -0
  451. package/src/specs/Dh.nitro.ts +343 -0
  452. package/src/specs/DirTree.nitro.ts +332 -0
  453. package/src/specs/Dkim.nitro.ts +595 -0
  454. package/src/specs/Dns.nitro.ts +271 -0
  455. package/src/specs/Dsa.nitro.ts +653 -0
  456. package/src/specs/DtObj.nitro.ts +198 -0
  457. package/src/specs/Ecc.nitro.ts +375 -0
  458. package/src/specs/EdDSA.nitro.ts +273 -0
  459. package/src/specs/Email.nitro.ts +2921 -0
  460. package/src/specs/EmailBundle.nitro.ts +334 -0
  461. package/src/specs/FileAccess.nitro.ts +836 -0
  462. package/src/specs/Ftp2.nitro.ts +3943 -0
  463. package/src/specs/Global.nitro.ts +319 -0
  464. package/src/specs/Gzip.nitro.ts +646 -0
  465. package/src/specs/Hashtable.nitro.ts +356 -0
  466. package/src/specs/HtmlToText.nitro.ts +238 -0
  467. package/src/specs/HtmlToXml.nitro.ts +323 -0
  468. package/src/specs/Http.nitro.ts +3095 -0
  469. package/src/specs/HttpCurl.nitro.ts +550 -0
  470. package/src/specs/HttpRequest.nitro.ts +522 -0
  471. package/src/specs/HttpResponse.nitro.ts +424 -0
  472. package/src/specs/Imap.nitro.ts +2991 -0
  473. package/src/specs/JavaKeyStore.nitro.ts +619 -0
  474. package/src/specs/Js.nitro.ts +263 -0
  475. package/src/specs/JsonArray.nitro.ts +681 -0
  476. package/src/specs/JsonObject.nitro.ts +1454 -0
  477. package/src/specs/Jwe.nitro.ts +756 -0
  478. package/src/specs/Jws.nitro.ts +733 -0
  479. package/src/specs/Jwt.nitro.ts +380 -0
  480. package/src/specs/Log.nitro.ts +258 -0
  481. package/src/specs/MailMan.nitro.ts +3571 -0
  482. package/src/specs/Mailboxes.nitro.ts +251 -0
  483. package/src/specs/Mcp.nitro.ts +491 -0
  484. package/src/specs/MessageSet.nitro.ts +320 -0
  485. package/src/specs/Mht.nitro.ts +1684 -0
  486. package/src/specs/Mime.nitro.ts +1745 -0
  487. package/src/specs/Ntlm.nitro.ts +556 -0
  488. package/src/specs/OAuth1.nitro.ts +331 -0
  489. package/src/specs/OAuth2.nitro.ts +1023 -0
  490. package/src/specs/Pdf.nitro.ts +740 -0
  491. package/src/specs/Pem.nitro.ts +484 -0
  492. package/src/specs/Pfx.nitro.ts +1003 -0
  493. package/src/specs/Pkcs11.nitro.ts +559 -0
  494. package/src/specs/PrivateKey.nitro.ts +994 -0
  495. package/src/specs/Prng.nitro.ts +348 -0
  496. package/src/specs/PublicKey.nitro.ts +610 -0
  497. package/src/specs/Rest.nitro.ts +1972 -0
  498. package/src/specs/Rsa.nitro.ts +453 -0
  499. package/src/specs/SCard.nitro.ts +739 -0
  500. package/src/specs/SFtp.nitro.ts +3138 -0
  501. package/src/specs/SFtpDir.nitro.ts +213 -0
  502. package/src/specs/SFtpFile.nitro.ts +452 -0
  503. package/src/specs/ScMinidriver.nitro.ts +443 -0
  504. package/src/specs/Scp.nitro.ts +708 -0
  505. package/src/specs/Secrets.nitro.ts +470 -0
  506. package/src/specs/SecureString.nitro.ts +231 -0
  507. package/src/specs/ServerSentEvent.nitro.ts +183 -0
  508. package/src/specs/Socket.nitro.ts +3335 -0
  509. package/src/specs/Spider.nitro.ts +609 -0
  510. package/src/specs/Ssh.nitro.ts +2842 -0
  511. package/src/specs/SshKey.nitro.ts +740 -0
  512. package/src/specs/SshTunnel.nitro.ts +1243 -0
  513. package/src/specs/Stream.nitro.ts +737 -0
  514. package/src/specs/StringArray.nitro.ts +396 -0
  515. package/src/specs/StringBuilder.nitro.ts +920 -0
  516. package/src/specs/StringTable.nitro.ts +271 -0
  517. package/src/specs/Tar.nitro.ts +804 -0
  518. package/src/specs/TrustedRoots.nitro.ts +360 -0
  519. package/src/specs/UnixCompress.nitro.ts +293 -0
  520. package/src/specs/Upload.nitro.ts +623 -0
  521. package/src/specs/Url.nitro.ts +246 -0
  522. package/src/specs/WebSocket.nitro.ts +840 -0
  523. package/src/specs/Xml.nitro.ts +1988 -0
  524. package/src/specs/XmlCertVault.nitro.ts +259 -0
  525. package/src/specs/XmlDSig.nitro.ts +464 -0
  526. package/src/specs/XmlDSigGen.nitro.ts +978 -0
  527. package/src/specs/Xmp.nitro.ts +364 -0
  528. package/src/specs/Zip.nitro.ts +1611 -0
  529. package/src/specs/ZipCrc.nitro.ts +229 -0
  530. package/src/specs/ZipEntry.nitro.ts +782 -0
@@ -0,0 +1,3335 @@
1
+ // Generated by ReactNativeNs.RnGenerator -- do not edit.
2
+ import type { HybridObject } from 'react-native-nitro-modules'
3
+ import type { BinData } from './BinData.nitro'
4
+ import type { Cert } from './Cert.nitro'
5
+ import type { JsonObject } from './JsonObject.nitro'
6
+ import type { Ssh } from './Ssh.nitro'
7
+ import type { SshKey } from './SshKey.nitro'
8
+ import type { StringBuilder } from './StringBuilder.nitro'
9
+
10
+ /**
11
+ * Build custom TCP, TLS, proxy, SSH-tunneled, client/server, and socket-level protocols.
12
+ *
13
+ * `Socket` is the low-level networking class for
14
+ * applications that need direct control over TCP and TLS communication. It can
15
+ * connect as a client, accept incoming connections, send and receive text or
16
+ * binary data, use proxies or SSH tunnels, configure TLS certificates and
17
+ * socket options, manage timeouts, work with socket sets, collect performance
18
+ * counters, and produce detailed diagnostics and session logs for custom
19
+ * protocol troubleshooting.
20
+ *
21
+ * **TCP client connections**
22
+ *
23
+ * Connect to remote hosts and ports for custom protocols or direct
24
+ * socket-level communication.
25
+ *
26
+ * **TLS and certificates**
27
+ *
28
+ * Use SSL/TLS, inspect certificates, provide client certificates, and
29
+ * control TLS-related behavior when secure sockets are required.
30
+ *
31
+ * **Send and receive data**
32
+ *
33
+ * Send and receive strings, byte data, files, fixed-size blocks,
34
+ * delimiter-terminated messages, or protocol-specific data patterns.
35
+ *
36
+ * **Server-side sockets**
37
+ *
38
+ * Listen for and accept incoming client connections when implementing
39
+ * simple socket servers or custom listener workflows.
40
+ *
41
+ * **Proxy and SSH tunneling**
42
+ *
43
+ * Route socket connections through HTTP proxies, SOCKS proxies, or
44
+ * SSH-tunneled connections when network topology requires it.
45
+ *
46
+ * **Timeouts and diagnostics**
47
+ *
48
+ * Configure connection and read/write timeouts, monitor counters, and use
49
+ * logs and `LastErrorText` to diagnose connection or protocol
50
+ * failures.
51
+ *
52
+ * **Common pattern:**
53
+ * Use `Socket` when the application is implementing a custom
54
+ * protocol or needs lower-level control than higher-level Chilkat classes
55
+ * provide. Configure the connection, TLS, proxy, timeout, and logging options,
56
+ * connect or accept a client, then send and receive data according to the
57
+ * protocol. Use higher-level classes such as `Http`,
58
+ * `Rest`, `Ssh`, `SFtp`, or
59
+ * `MailMan` when the protocol is already directly supported.
60
+ *
61
+ * For an extended overview, see
62
+ * [Socket Class Overview](https://www.chilkatsoft.com/socket_class_overview.asp).
63
+ *
64
+ * Each `Socket` instance owns a native Chilkat object. It is released when the JavaScript object is
65
+ * garbage collected, or immediately by `dispose()`; any use after `dispose()` throws.
66
+ * Create one with `new Socket()`.
67
+ *
68
+ * Methods that can take a while (network, files, compression, key generation) also have an
69
+ * `...Async` form returning a `Promise`; it runs on a native worker thread so the UI keeps
70
+ * rendering. While such a call is pending, every other call on this object throws, except
71
+ * {@link Socket.abort} and assigning {@link Socket.onPercentDone} / {@link Socket.onProgressInfo}.
72
+ */
73
+ export interface Socket extends HybridObject<{ ios: 'c++', android: 'c++' }> {
74
+ // ---- Properties ----
75
+
76
+ /**
77
+ * Provides HTML-formatted information about the last called method or property. If a method call
78
+ * fails or behaves unexpectedly, check this property for details. Note that information is
79
+ * available regardless of the method call's success.
80
+ *
81
+ * This property is read-only.
82
+ */
83
+ readonly lastErrorHtml: string
84
+
85
+ /**
86
+ * Provides plain text information about the last called method or property. If a method call
87
+ * fails or behaves unexpectedly, check this property for details. Note that information is
88
+ * available regardless of the method call's success.
89
+ *
90
+ * This property is read-only.
91
+ */
92
+ readonly lastErrorText: string
93
+
94
+ /**
95
+ * Provides XML-formatted information about the last called method or property. If a method call
96
+ * fails or behaves unexpectedly, check this property for details. Note that information is
97
+ * available regardless of the method call's success.
98
+ *
99
+ * This property is read-only.
100
+ */
101
+ readonly lastErrorXml: string
102
+
103
+ /**
104
+ * Version of the component/library, such as "10.1.0"
105
+ *
106
+ * This property is read-only.
107
+ */
108
+ readonly version: string
109
+
110
+ /**
111
+ * If set to a file path, this property logs the LastErrorText of each Chilkat method or property
112
+ * call to the specified file. This logging helps identify the context and history of Chilkat
113
+ * calls leading up to any crash or hang, aiding in debugging.
114
+ *
115
+ * Enabling the VerboseLogging property provides more detailed information.
116
+ *
117
+ * This property is mainly used for debugging rare instances where a Chilkat method call causes a
118
+ * hang or crash, which should generally not happen.
119
+ *
120
+ * Possible causes of hangs include:
121
+ *
122
+ * - A timeout property set to 0, indicating an infinite timeout.
123
+ *
124
+ * - A hang occurring within an event callback in the application code.
125
+ *
126
+ * - An internal bug in the Chilkat code causing the hang.
127
+ */
128
+ debugLogFilePath: string
129
+
130
+ /**
131
+ * If set to `true`, then the contents of LastErrorText (or LastErrorXml, or LastErrorHtml) may
132
+ * contain more verbose information. The default value is `false`. Verbose logging should only be
133
+ * used for debugging. The potentially large quantity of logged information may adversely affect
134
+ * peformance.
135
+ */
136
+ verboseLogging: boolean
137
+
138
+ /**
139
+ * Indicates the success or failure of the most recent method call: `true` means success, `false`
140
+ * means failure. This property remains unchanged by property setters or getters. This method is
141
+ * present to address challenges in checking for null or Nothing returns in certain programming
142
+ * languages. Note: This property does not apply to methods that return integer values or to
143
+ * boolean-returning methods where the boolean does not indicate success or failure.
144
+ */
145
+ lastMethodSuccess: boolean
146
+
147
+ /**
148
+ * Set this property to `true` to request cancellation of the method currently executing on this
149
+ * object. It affects operations that can block or take significant time, such as network reads,
150
+ * writes, connection establishment, and long-running asynchronous methods. Fast, nonblocking
151
+ * methods may finish before the cancellation request is observed.
152
+ *
153
+ * After an operation aborts, Chilkat automatically resets this property to `false`. If no
154
+ * operation is running, the next method call clears a previously set value before it begins.
155
+ *
156
+ * **Note:** A synchronous call can be cancelled from another thread by setting this property on
157
+ * the same object. The method returns its normal failure value, and `LastErrorText` describes the
158
+ * abort.
159
+ */
160
+ abortCurrent: boolean
161
+
162
+ /**
163
+ * Contains the numeric result for the most recent `AcceptNext` or deprecated
164
+ * `AcceptNextConnection` operation. The initial value is `0`. It is reset to `0` when an accept
165
+ * begins, remains `0` on success, and is set to a reason code on failure.
166
+ *
167
+ * **May describe an older accept:** Connect, send, receive, and ordinary property operations do
168
+ * not clear this property. Read it immediately after the accept operation whose result is being
169
+ * examined.
170
+ *
171
+ * CodeMeaning
172
+ *
173
+ * | 0 | | Success. |
174
+ *
175
+ * | 1 | | An asynchronous accept operation is already in progress. |
176
+ *
177
+ * | 3 | | Internal failure, such as an allocation failure. |
178
+ *
179
+ * | 5 | | No incoming connection was accepted before the wait interval expired. |
180
+ *
181
+ * | 6 | | The operation was aborted by the application. |
182
+ *
183
+ * | 9 | | An unspecified fatal socket error occurred. |
184
+ *
185
+ * | 20 | | The socket has not first been bound and placed into listening mode. |
186
+ *
187
+ * | 99 | | The Chilkat component is not unlocked. |
188
+ *
189
+ * | 100 | | TLS internal error. |
190
+ *
191
+ * | 102 | | Unexpected TLS handshake message. |
192
+ *
193
+ * | 109 | | Failed to read TLS handshake messages. |
194
+ *
195
+ * | 114 | | Failed to send the ChangeCipherSpec message. |
196
+ *
197
+ * | 115 | | Failed to send the Finished message. |
198
+ *
199
+ * | 116 | | The client's Finished message was invalid. |
200
+ *
201
+ * | 117 | | Unable to agree on a TLS protocol version. |
202
+ *
203
+ * | 118 | | Unable to agree on a cipher suite. |
204
+ *
205
+ * | 119 | | Failed to read the client's ClientHello message. |
206
+ *
207
+ * | 120 | | Failed to send TLS handshake messages. |
208
+ *
209
+ * | 121 | | Failed to process the client certificate message. |
210
+ *
211
+ * | 122 | | Failed to process the client certificate URL message. |
212
+ *
213
+ * | 123 | | Failed to process the client key-exchange message. |
214
+ *
215
+ * | 124 | | Failed to process the CertificateVerify message. |
216
+ *
217
+ * | 125 | | An SSL 2.0 connection attempt was received and rejected. |
218
+ *
219
+ * This property is read-only.
220
+ */
221
+ readonly acceptFailReason: number
222
+
223
+ /**
224
+ * Limits receive throughput to approximately the specified number of bytes per second. The
225
+ * default value is `0`, which disables receive throttling.
226
+ *
227
+ * **Note:** The limit is approximate and is applied over time; it does not define socket packet
228
+ * sizes or message boundaries.
229
+ */
230
+ bandwidthThrottleDown: number
231
+
232
+ /**
233
+ * Limits send throughput to approximately the specified number of bytes per second. The default
234
+ * value is `0`, which disables send throttling.
235
+ *
236
+ * **Note:** The limit is approximate and is applied over time; it does not define socket packet
237
+ * sizes or message boundaries.
238
+ */
239
+ bandwidthThrottleUp: number
240
+
241
+ /**
242
+ * Controls the byte order used by `SendCount` and `ReceiveCount`. The default is `true`, which
243
+ * uses big-endian byte order (network byte order). Set it to `false` to use little-endian byte
244
+ * order.
245
+ *
246
+ * **Note:** This property applies only to the four-byte count methods. The `SendInt16`,
247
+ * `SendInt32`, `ReceiveInt16`, and `ReceiveInt32` methods receive their byte-order choice as an
248
+ * argument.
249
+ */
250
+ bigEndian: boolean
251
+
252
+ /**
253
+ * Specifies a numeric local IP address to use when binding the socket to a local interface.
254
+ *
255
+ * - **Outbound connections:** Before `Connect` establishes the connection, the local socket is
256
+ * bound to this address. Leave the property empty to let the operating system choose the local
257
+ * source address.
258
+ *
259
+ * - **Listeners:** `BindAndListen` and `BindAndListenPortRange` bind to exactly this address.
260
+ * Leave the property empty to listen on all interfaces: `0.0.0.0` for IPv4 or `::` for IPv6.
261
+ *
262
+ * `ClientIpAddress`IPv6 preferenceListener bind address
263
+ *
264
+ * | Empty | | `false` | | `0.0.0.0` (all IPv4 interfaces) |
265
+ *
266
+ * | Empty | | `true` | | `::` (all IPv6 interfaces) |
267
+ *
268
+ * | Explicit address | | Not used to choose the family | | Exactly the specified address |
269
+ *
270
+ * **Important:** Supply a numeric IPv4 or IPv6 address assigned to the local computer, not a DNS
271
+ * hostname or remote address. Setting `127.0.0.1` or `::1` creates a loopback-only listener that
272
+ * remote computers cannot reach.
273
+ */
274
+ clientIpAddress: string
275
+
276
+ /**
277
+ * Specifies the local TCP port to bind before initiating an outbound connection. The default
278
+ * value is `0`, which asks the operating system to choose an available ephemeral port.
279
+ *
280
+ * **Important:** Setting a fixed client port is unusual and can cause connection failures when
281
+ * the port is already in use or unavailable. Use a nonzero value only when the remote system or
282
+ * network policy explicitly requires a particular source port.
283
+ */
284
+ clientPort: number
285
+
286
+ /**
287
+ * Contains the numeric result for the most recent connect-family operation, including TCP
288
+ * connection and SSH connection/channel setup. The initial value is `0`. It is reset to `0` when
289
+ * a connect-family call begins, remains `0` on success, and is set to a reason code on failure.
290
+ *
291
+ * **May describe an older connection attempt:** Send, receive, accept, and ordinary property
292
+ * operations do not clear this property. Read it immediately after the connect-family operation
293
+ * whose result is being examined; otherwise it may still contain a reason from an earlier
294
+ * attempt.
295
+ *
296
+ * CodeMeaning
297
+ *
298
+ * | 0 | | Success. |
299
+ *
300
+ * | 1 | | The hostname is empty. |
301
+ *
302
+ * | 2 | | DNS lookup failed. |
303
+ *
304
+ * | 3 | | DNS lookup timed out. |
305
+ *
306
+ * | 4 | | The operation was aborted by the application. |
307
+ *
308
+ * | 5 | | Internal failure. |
309
+ *
310
+ * | 6 | | The TCP connection attempt timed out. |
311
+ *
312
+ * | 7 | | The connection was rejected or otherwise could not be established. |
313
+ *
314
+ * | 100 | | TLS internal error. |
315
+ *
316
+ * | 101 | | Failed to send ClientHello. |
317
+ *
318
+ * | 102 | | Unexpected TLS handshake message. |
319
+ *
320
+ * | 103 | | Failed to read ServerHello. |
321
+ *
322
+ * | 104 | | The server did not provide a certificate. |
323
+ *
324
+ * | 105 | | Unexpected TLS protocol version. |
325
+ *
326
+ * | 106 | | Server-certificate verification failed. |
327
+ *
328
+ * | 107 | | The negotiated TLS protocol version was not permitted. |
329
+ *
330
+ * | 108 | | An application-defined server-certificate requirement failed. |
331
+ *
332
+ * | 109 | | Failed to read TLS handshake messages. |
333
+ *
334
+ * | 110 | | Failed to send the client-certificate message. |
335
+ *
336
+ * | 111 | | Failed to send the client key-exchange message. |
337
+ *
338
+ * | 112 | | The client certificate's private key was not accessible. |
339
+ *
340
+ * | 113 | | Failed to send the client CertificateVerify message. |
341
+ *
342
+ * | 114 | | Failed to send the ChangeCipherSpec message. |
343
+ *
344
+ * | 115 | | Failed to send the Finished message. |
345
+ *
346
+ * | 116 | | The server's Finished message was invalid. |
347
+ *
348
+ * **Note:** The TCP connection timeout supplied to `Connect` is distinct from DNS, proxy, and
349
+ * TLS-handshake inactivity limits. See `MaxReadIdleMs` and `MaxSendIdleMs`.
350
+ *
351
+ * This property is read-only.
352
+ */
353
+ readonly connectFailReason: number
354
+
355
+ /**
356
+ * Returns the whole number of seconds elapsed since the most recent call to `StartTiming`. It
357
+ * returns `0` if timing has not been started or less than one second has elapsed.
358
+ *
359
+ * **Note:** This convenience timer is associated with the object; it is not a network timeout and
360
+ * does not affect socket operations.
361
+ *
362
+ * This property is read-only.
363
+ */
364
+ readonly elapsedSeconds: number
365
+
366
+ /**
367
+ * Specifies the interval, in milliseconds, between `AbortCheck` callbacks during supported
368
+ * long-running operations. The default is `0`, which disables periodic `AbortCheck` callbacks.
369
+ *
370
+ * **Note:** This setting does not send network heartbeat packets and does not implement TCP
371
+ * keepalive. It only controls application callbacks that provide an opportunity to cancel an
372
+ * operation.
373
+ */
374
+ heartbeatMs: number
375
+
376
+ /**
377
+ * Specifies the authentication method used with an HTTP proxy. Supported values are `Basic` and
378
+ * `NTLM`. Leave it empty when the proxy does not require authentication.
379
+ *
380
+ * **Important:** Basic proxy credentials are only encoded, not encrypted. Protect them by using
381
+ * an appropriate secure network path to the proxy.
382
+ */
383
+ httpProxyAuthMethod: string
384
+
385
+ /**
386
+ * Specifies the optional Windows domain used for NTLM authentication to an HTTP proxy. It is
387
+ * ignored unless `HttpProxyAuthMethod` is `NTLM`.
388
+ */
389
+ httpProxyDomain: string
390
+
391
+ /**
392
+ * Specifies the hostname or numeric IP address of the HTTP proxy. Leave it empty to connect
393
+ * directly without an HTTP proxy.
394
+ */
395
+ httpProxyHostname: string
396
+
397
+ /**
398
+ * Specifies the password used to authenticate with the HTTP proxy. It is used together with
399
+ * `HttpProxyUsername` and the selected `HttpProxyAuthMethod`.
400
+ *
401
+ * **Important:** Do not write proxy passwords to logs or expose them in diagnostic output.
402
+ */
403
+ httpProxyPassword: string
404
+
405
+ /**
406
+ * Specifies the TCP port of the HTTP proxy. Common values include `8080` and `3128`, but the
407
+ * correct port is determined by the proxy configuration.
408
+ */
409
+ httpProxyPort: number
410
+
411
+ /**
412
+ * Specifies the username used to authenticate with the HTTP proxy. It is ignored when the proxy
413
+ * does not require authentication.
414
+ */
415
+ httpProxyUsername: string
416
+
417
+ /**
418
+ * Returns `true` when the socket is in its last known connected state; otherwise returns `false`.
419
+ * Explicitly closing the socket updates this property immediately.
420
+ *
421
+ * **Important:** TCP does not continuously notify an idle application that a peer or network path
422
+ * has disappeared. This property can remain `true` until a read, write, or other socket operation
423
+ * detects the loss. Treat it as a cached state indicator, not a guarantee that the next operation
424
+ * will succeed.
425
+ *
426
+ * This property is read-only.
427
+ */
428
+ readonly isConnected: boolean
429
+
430
+ /**
431
+ * Controls the operating system `SO_KEEPALIVE` option for the underlying TCP socket. The default
432
+ * is `true`.
433
+ *
434
+ * **Note:** TCP keepalive is distinct from an application-protocol heartbeat. The operating
435
+ * system controls the keepalive timing and retry policy unless configured by platform-specific
436
+ * means.
437
+ */
438
+ keepAlive: boolean
439
+
440
+ /**
441
+ * Set this property to `true` to record bytes sent and received through this wrapper in
442
+ * `SessionLog`. The default is `false`. Use `SessionLogEncoding` to choose how bytes are
443
+ * rendered.
444
+ *
445
+ * **Important:** Session logs can contain credentials, tokens, private application data, or
446
+ * decrypted TLS payloads. Enable logging only for diagnostics and protect or remove the resulting
447
+ * data.
448
+ */
449
+ keepSessionLog: boolean
450
+
451
+ /**
452
+ * Returns `true` if the most recent action method called through this wrapper failed; otherwise
453
+ * returns `false`. The initial value is `false`. An action method clears this state when it
454
+ * begins and leaves it `false` on success or sets it to `true` on failure.
455
+ *
456
+ * Ordinary value-property getters, such as the local and remote address/port properties, timeout
457
+ * properties, `Ssl`, `BigEndian`, and the failure-reason properties, do not change this state.
458
+ * Methods that perform work do change it, including certificate-retrieval methods,
459
+ * `BuildHttpGetRequest`, and `ClearSessionLog`.
460
+ *
461
+ * **Check immediately:** This property describes only the most recent action method. Another
462
+ * method call may overwrite it before it is examined. Prefer the method's own Boolean return
463
+ * value when one is available.
464
+ *
465
+ * This property is read-only.
466
+ */
467
+ readonly lastMethodFailed: boolean
468
+
469
+ /**
470
+ * Returns the local numeric IP address for the socket connection currently held by this object.
471
+ * For an outbound connection, this is the source address selected or explicitly bound. For a
472
+ * listener, it is the address on which the socket is listening.
473
+ *
474
+ * Returns an empty string when the object holds no connection or listener. The value is read from
475
+ * the current connection and is never retained from an earlier connection.
476
+ *
477
+ * This property is read-only.
478
+ */
479
+ readonly localIpAddress: string
480
+
481
+ /**
482
+ * Returns the local TCP port for the socket connection or listener currently held by this object.
483
+ * When binding to port `0`, read this property or `ListenPort` after success to discover the
484
+ * operating-system-selected port.
485
+ *
486
+ * Returns `0` when the object holds no connection or listener. The value is read from the current
487
+ * connection and is never retained from an earlier connection.
488
+ *
489
+ * This property is read-only.
490
+ */
491
+ readonly localPort: number
492
+
493
+ /**
494
+ * Specifies the maximum number of milliseconds that a read-related operation
495
+ * may make no receive progress. A positive value is an \*inactivity\*
496
+ * timeout, not a total-operation deadline. The timer restarts each time a
497
+ * successful low-level read transfers at least one byte.
498
+ *
499
+ * - `0` means no read-idle timeout and permits an indefinite wait.
500
+ *
501
+ * - A positive value limits the longest continuous period with no received data.
502
+ *
503
+ * - Negative values have no defined meaning and should not be used.
504
+ *
505
+ * This property applies to socket receive methods and to protocol exchanges
506
+ * that read from the connection, including TLS handshakes. It also ordinarily
507
+ * governs read inactivity during HTTP/SOCKS proxy negotiation and SSH tunnel
508
+ * setup when no separate timeout is provided.
509
+ *
510
+ * **Idle timeout versus total duration:**
511
+ * A long transfer can continue for longer than this value as long as data keeps
512
+ * arriving. The timeout occurs only when no read progress is made for the full
513
+ * configured interval.
514
+ *
515
+ * **Indefinite waits:**
516
+ * The default is `0`. For operations involving an externally
517
+ * controlled peer, proxy, TLS handshake, or SSH service, consider setting a
518
+ * finite value so an unresponsive endpoint cannot block the operation forever.
519
+ */
520
+ maxReadIdleMs: number
521
+
522
+ /**
523
+ * Specifies the maximum number of milliseconds that a send-related operation
524
+ * may make no write progress. A positive value is an \*inactivity\*
525
+ * timeout, not a total-operation deadline. The timer restarts each time a
526
+ * successful low-level write transfers at least one byte.
527
+ *
528
+ * - `0` means no send-idle timeout and permits an indefinite wait.
529
+ *
530
+ * - A positive value limits the longest continuous period with no send progress.
531
+ *
532
+ * - Negative values have no defined meaning and should not be used.
533
+ *
534
+ * This property applies to socket send methods and to protocol exchanges that
535
+ * write to the connection, including TLS handshakes. It also ordinarily governs
536
+ * write inactivity during HTTP/SOCKS proxy negotiation and SSH tunnel setup
537
+ * when no separate timeout is provided.
538
+ *
539
+ * **Idle timeout versus total duration:**
540
+ * A large send can continue for longer than this value while bytes continue to
541
+ * move. The timeout occurs only after the full configured interval passes with
542
+ * no write progress.
543
+ */
544
+ maxSendIdleMs: number
545
+
546
+ /**
547
+ * Returns a local IP address for the computer. On a multihomed system, this is a default or
548
+ * preferred local address and may not be the address used by a particular connection.
549
+ *
550
+ * **Note:** This is normally a private or internal address and is not a reliable way to discover
551
+ * a public Internet address behind NAT. For an actual bound or connected socket, use
552
+ * `LocalIpAddress` and `LocalPort`.
553
+ *
554
+ * This property is read-only.
555
+ */
556
+ readonly myIpAddress: string
557
+
558
+ /**
559
+ * Returns the number of client certificates associated with the connection currently held by this
560
+ * object. On a TLS server, read this property on the accepted connection populated by
561
+ * `AcceptNext`, then call `GetRcvdClientCert` with indexes from `0` through
562
+ * `NumReceivedClientCerts - 1`.
563
+ *
564
+ * Returns `0` when the current connection has no received client certificates or when the object
565
+ * holds no connection. The value is read from the current connection and is never retained from
566
+ * an earlier connection. If `ConvertFromSsl` removes TLS while preserving the underlying
567
+ * connection, the certificate information can remain associated with that same connection.
568
+ *
569
+ * **Important:** Read this property on the accepted connection, not on the listener. Client
570
+ * certificates are normally present only when the server requested mutual TLS authentication.
571
+ *
572
+ * This property is read-only.
573
+ */
574
+ readonly numReceivedClientCerts: number
575
+
576
+ /**
577
+ * Returns the number of sockets contained in this object's socket set. A normal `Socket` object
578
+ * becomes a socket set after one or more successful calls to `TakeSocket`. Listener sockets and
579
+ * connected sockets may coexist in the same set.
580
+ *
581
+ * A socket whose peer has closed may remain in the set, and remain included in this count, until
582
+ * the next `SelectForReading` or `SelectForWriting`. A select operation rebuilds the set and
583
+ * automatically prunes members that no longer have a usable descriptor.
584
+ *
585
+ * **Selection:** Use `SelectorIndex` for a direct set position. After a select call, use
586
+ * `SelectorReadIndex` or `SelectorWriteIndex` directly; do not translate the ready index into
587
+ * `SelectorIndex`.
588
+ *
589
+ * **Socket sets overview:** See [Socket Sets
590
+ * Overview](https://www.chilkatsoft.com/socket_sets.asp) for an explanation of socket sets,
591
+ * selectors, readiness, ownership, and common usage patterns.
592
+ *
593
+ * This property is read-only.
594
+ */
595
+ readonly numSocketsInSet: number
596
+
597
+ /**
598
+ * Returns the number of acceptable certificate-authority distinguished names supplied by the TLS
599
+ * server for the connection currently held by this object. Use `GetSslAcceptableClientCaDn` to
600
+ * retrieve each DN by zero-based index.
601
+ *
602
+ * Returns `0` when the current connection supplied no acceptable-CA list or when the object holds
603
+ * no connection. This value is read from the current connection and is never retained from an
604
+ * earlier connection.
605
+ *
606
+ * **Note:** The list is guidance from the server for selecting a client certificate. It does not
607
+ * itself authenticate the server or guarantee that a particular client certificate will be
608
+ * accepted.
609
+ *
610
+ * This property is read-only.
611
+ */
612
+ readonly numSslAcceptableClientCAs: number
613
+
614
+ /**
615
+ * Returns the unique identifier assigned to this socket object. The identifier is included in
616
+ * event callbacks so an application can associate a callback with the originating object.
617
+ *
618
+ * **Note:** The value is for runtime correlation only and should not be persisted as a durable
619
+ * identifier.
620
+ *
621
+ * This property is read-only.
622
+ */
623
+ readonly objectId: number
624
+
625
+ /**
626
+ * Defines the numeric value that represents 100 percent in `PercentDone` callbacks. The default
627
+ * is `100`. For example, a scale of `1000` permits tenths-of-a-percent values, so `453`
628
+ * represents 45.3 percent.
629
+ *
630
+ * Values are clamped to the range `10` through `100000`. The property affects only operations
631
+ * whose progress can be measured and only language bindings that expose callbacks.
632
+ */
633
+ percentDoneScale: number
634
+
635
+ /**
636
+ * This property and `ListenIpv6` are two names for the same underlying setting. Reading or
637
+ * writing either property reads or changes the same value. The default is `false`.
638
+ *
639
+ * - **Outbound connections:** When a hostname resolves to both IPv4 and IPv6 addresses, `false`
640
+ * prefers IPv4 and `true` prefers IPv6.
641
+ *
642
+ * - **Listeners:** When `ClientIpAddress` is empty, `false` binds to `0.0.0.0` and `true` binds
643
+ * to `::`. When an explicit `ClientIpAddress` is set, its literal address determines the
644
+ * family.
645
+ *
646
+ * **Note:** A preference does not guarantee that the selected address family is usable.
647
+ * Connection success still depends on DNS results, local routing, firewall policy, and peer
648
+ * availability.
649
+ */
650
+ preferIpv6: boolean
651
+
652
+ /**
653
+ * Contains the numeric result for the most recent receive-side operation. The initial value is
654
+ * `0`. It is reset to `0` when a receive begins, remains `0` on success, and is set to a reason
655
+ * code on failure.
656
+ *
657
+ * **May describe an older receive:** Connect, accept, send, and ordinary property operations do
658
+ * not clear this property. Read it immediately after the receive operation whose result is being
659
+ * examined.
660
+ *
661
+ * CodeMeaning
662
+ *
663
+ * | 0 | | Success. |
664
+ *
665
+ * | 1 | | An asynchronous receive operation is already in progress. |
666
+ *
667
+ * | 2 | | The socket is not connected. |
668
+ *
669
+ * | 3 | | Internal failure, such as an allocation failure. |
670
+ *
671
+ * | 4 | | Invalid parameters were supplied. For delimiter-based receives, this includes an empty
672
+ * match string or a match string that encodes to zero bytes. |
673
+ *
674
+ * | 5 | | No additional data arrived within `MaxReadIdleMs`. |
675
+ *
676
+ * | 6 | | The operation was aborted by the application. |
677
+ *
678
+ * | 7 | | The peer reset the connection. |
679
+ *
680
+ * | 8 | | The host operating system aborted the established connection. |
681
+ *
682
+ * | 9 | | An unspecified fatal socket error occurred. |
683
+ *
684
+ * | 10 | | The peer closed the connection normally. The method reports failure, but its output
685
+ * may still contain final data received immediately before the close. |
686
+ *
687
+ * **Failure does not imply zero received bytes:**
688
+ * A receive method may consume bytes before it fails. Those bytes remain counted
689
+ * by `ReceivedCount`. Depending on the receive method, partial data may
690
+ * be returned, appended to the destination, or discarded. Consult the specific
691
+ * method description.
692
+ *
693
+ * **Connection state after failure:**
694
+ * A timeout or application abort generally leaves the connection open. A peer
695
+ * close or reset leaves it unavailable for further I/O, although the
696
+ * `Socket` object may still be closed or reused for a new
697
+ * `Connect` operation.
698
+ *
699
+ * This property is read-only.
700
+ */
701
+ readonly receiveFailReason: number
702
+
703
+ /**
704
+ * Controls the maximum number of bytes requested by availability-based receive
705
+ * methods when Chilkat must perform a direct read from a plain TCP connection.
706
+ * The default value is `4096`.
707
+ *
708
+ * -
709
+ * For plain TCP, methods such as `ReceiveBytes`,
710
+ * `ReceiveBd`, `ReceiveString`, and
711
+ * `ReceiveSb` obtain at most this many bytes from one underlying
712
+ * socket read.
713
+ *
714
+ * -
715
+ * For TLS and SSH connections, the amount returned is governed by the TLS
716
+ * record or SSH packet and is not limited by this property.
717
+ *
718
+ * -
719
+ * Data already buffered internally by Chilkat is returned in full, even when
720
+ * it exceeds `ReceivePacketSize`.
721
+ *
722
+ * **TCP framing:**
723
+ * This property is not a message-size setting. TCP is a byte stream and does
724
+ * not preserve application message boundaries.
725
+ */
726
+ receivePacketSize: number
727
+
728
+ /**
729
+ * Tracks the cumulative number of application bytes actually received from the connection by
730
+ * receive operations. The application may assign `0` at any time to restart the count.
731
+ *
732
+ * Bytes pulled from the connection remain included even when the receive method ultimately
733
+ * returns failure. A failed call does not roll the counter back. For example, partial bytes
734
+ * consumed before a timeout, abort, close, or reset are still counted, even when the method does
735
+ * not return those bytes to the caller.
736
+ *
737
+ * The count can be greater than the number of bytes returned by a particular method because
738
+ * Chilkat may read beyond a delimiter or exact requested length and buffer the excess for a later
739
+ * receive call. TLS and SSH framing overhead is not included.
740
+ *
741
+ * **Note:** Use `RcvBytesPerSec` when measuring raw transfer rate including protocol overhead.
742
+ */
743
+ receivedCount: number
744
+
745
+ /**
746
+ * Contains the value produced by the most recent successful call through this wrapper to
747
+ * `ReceiveByte`, `ReceiveInt16`, or `ReceiveInt32`. The initial value is `0`. The signedness and
748
+ * byte order are determined by the arguments supplied to the receive method.
749
+ *
750
+ * This property is never cleared automatically. It changes only after a successful integer
751
+ * receive or when the application explicitly assigns a value to it. A failed integer receive
752
+ * leaves the previous value unchanged.
753
+ *
754
+ * **May contain a stale value:** Read `ReceivedInt` only after the corresponding receive method
755
+ * has returned success. After a failed call it may still contain a valid-looking value from an
756
+ * earlier operation.
757
+ */
758
+ receivedInt: number
759
+
760
+ /**
761
+ * Returns the numeric IP address of the peer for the connection currently held by this object.
762
+ * This is the address actually used by the established connection, which may differ from the
763
+ * hostname originally supplied to `Connect`.
764
+ *
765
+ * Returns an empty string when the object holds no connected peer. The value is read from the
766
+ * current connection and is never retained from an earlier connection.
767
+ *
768
+ * This property is read-only.
769
+ */
770
+ readonly remoteIpAddress: string
771
+
772
+ /**
773
+ * Returns the TCP port of the peer for the connection currently held by this object.
774
+ *
775
+ * Returns `0` when the object holds no connected peer. The value is read from the current
776
+ * connection and is never retained from an earlier connection.
777
+ *
778
+ * This property is read-only.
779
+ */
780
+ readonly remotePort: number
781
+
782
+ /**
783
+ * Controls verification of a server certificate when this object acts as a TLS client. The
784
+ * default is `false`.
785
+ *
786
+ * When `true`, the TLS connection is rejected if the server certificate is expired, not yet
787
+ * valid, has an invalid signature, or cannot be verified through a trusted certificate chain.
788
+ * When `false`, these normal certificate-validity and trust-chain checks are not required.
789
+ *
790
+ * **Independent checks:** `RequireSslCertVerify` controls normal certificate verification.
791
+ * Public-key pinning configured by `TlsPinSet` is a separate check and is enforced whenever a pin
792
+ * set is present, even when this property is `false`.
793
+ */
794
+ requireSslCertVerify: boolean
795
+
796
+ /**
797
+ * Selects a socket by its direct zero-based position in this object's socket set. Valid values
798
+ * range from `0` through `NumSocketsInSet - 1`. While this selector is active, ordinary
799
+ * connection methods and properties are routed to that contained socket.
800
+ *
801
+ * **Mutually exclusive selectors:** `SelectorIndex`, `SelectorReadIndex`, and
802
+ * `SelectorWriteIndex` are mutually exclusive. Assigning any one clears the other two. Do not
803
+ * copy a read-ready or write-ready index into `SelectorIndex`; setting `SelectorReadIndex` or
804
+ * `SelectorWriteIndex` already routes operations to the corresponding ready socket.
805
+ *
806
+ * **Index lifetime:** Direct set positions are renumbered whenever a member is removed. After a
807
+ * selected member is closed or another member is pruned, later positions shift down and an old
808
+ * `SelectorIndex` can identify a different socket or become out of range.
809
+ *
810
+ * **Socket sets overview:** See [Socket Sets
811
+ * Overview](https://www.chilkatsoft.com/socket_sets.asp) for an explanation of socket sets,
812
+ * selectors, readiness, ownership, and common usage patterns.
813
+ */
814
+ selectorIndex: number
815
+
816
+ /**
817
+ * Selects a zero-based position in the read-ready result produced by the most recent call to
818
+ * `SelectForReading`. If that call returned `n`, valid values are `0` through `n - 1`. After
819
+ * assigning this property, call `AcceptNext`, a receive method, or another ordinary connection
820
+ * operation on this socket-set object; the operation is routed directly to that ready socket.
821
+ *
822
+ * Reading this property returns exactly the ready-set position last assigned. It does not return
823
+ * or translate to the socket's direct position in the contained set, and no such translation is
824
+ * required.
825
+ *
826
+ * **Mutually exclusive selectors:** Assigning `SelectorReadIndex` clears `SelectorIndex` and
827
+ * `SelectorWriteIndex`. Do not set `SelectorIndex` afterward, because doing so discards the read
828
+ * selection and interprets the number as a direct set position.
829
+ *
830
+ * **Ready-set lifetime:** The ready-set and its ordering remain stable for the current select
831
+ * result, but the order is arbitrary and need not match insertion order. The next call to
832
+ * `SelectForReading` or `SelectForWriting` invalidates prior ready indices.
833
+ *
834
+ * **Socket sets overview:** See [Socket Sets
835
+ * Overview](https://www.chilkatsoft.com/socket_sets.asp) for an explanation of socket sets,
836
+ * selectors, readiness, ownership, and common usage patterns.
837
+ */
838
+ selectorReadIndex: number
839
+
840
+ /**
841
+ * Selects a zero-based position in the write-ready result produced by the most recent call to
842
+ * `SelectForWriting`. If that call returned `n`, valid values are `0` through `n - 1`. After
843
+ * assigning this property, ordinary connection operations on this socket-set object are routed
844
+ * directly to that ready socket.
845
+ *
846
+ * Reading this property returns exactly the ready-set position last assigned. It does not return
847
+ * or translate to the socket's direct position in the contained set.
848
+ *
849
+ * **Mutually exclusive selectors:** Assigning `SelectorWriteIndex` clears `SelectorIndex` and
850
+ * `SelectorReadIndex`. Do not set `SelectorIndex` afterward.
851
+ *
852
+ * **Ready-set lifetime:** The ready-set and its ordering remain stable for the current select
853
+ * result, but the order is arbitrary and need not match insertion order. The next select call
854
+ * invalidates prior ready indices.
855
+ *
856
+ * **Socket sets overview:** See [Socket Sets
857
+ * Overview](https://www.chilkatsoft.com/socket_sets.asp) for an explanation of socket sets,
858
+ * selectors, readiness, ownership, and common usage patterns.
859
+ */
860
+ selectorWriteIndex: number
861
+
862
+ /**
863
+ * Contains the numeric result for the most recent send-side operation. The initial value is `0`.
864
+ * It is reset to `0` when a send begins, remains `0` on success, and is set to a reason code on
865
+ * failure.
866
+ *
867
+ * **May describe an older send:** Connect, accept, receive, and ordinary property operations do
868
+ * not clear this property. Read it immediately after the send operation whose result is being
869
+ * examined.
870
+ *
871
+ * CodeMeaning
872
+ *
873
+ * | 0 | | Success. |
874
+ *
875
+ * | 1 | | An asynchronous send operation is already in progress. |
876
+ *
877
+ * | 2 | | The socket is not connected. |
878
+ *
879
+ * | 3 | | Internal failure, such as an allocation failure. |
880
+ *
881
+ * | 4 | | Invalid parameters were supplied. |
882
+ *
883
+ * | 5 | | The socket made no send progress for longer than `MaxSendIdleMs`. |
884
+ *
885
+ * | 6 | | The operation was aborted by the application. |
886
+ *
887
+ * | 7 | | The peer reset the connection. |
888
+ *
889
+ * | 8 | | The host operating system aborted the established connection. |
890
+ *
891
+ * | 9 | | An unspecified fatal socket error occurred. |
892
+ *
893
+ * | 10 | | The peer closed the connection. |
894
+ *
895
+ * | 11 | | Text or encoded input could not be converted or decoded, such as an invalid
896
+ * `StringCharset` conversion or malformed encoded data. |
897
+ *
898
+ * **A failed send may be partial:**
899
+ * Failure does not prove that zero bytes were sent. Chilkat does not retain the
900
+ * unsent remainder and does not report how much was transmitted. After a failed
901
+ * send, a framed protocol should normally discard the connection because the
902
+ * peer may have received a truncated message.
903
+ *
904
+ * **Connection state after failure:**
905
+ * A timeout or application abort generally leaves the TCP connection open, even
906
+ * though the protocol stream may no longer be safe to reuse. A peer close or
907
+ * reset leaves the connection unavailable for further I/O.
908
+ *
909
+ * This property is read-only.
910
+ */
911
+ readonly sendFailReason: number
912
+
913
+ /**
914
+ * Specifies the internal chunk size used when sending a large amount of data over a plain TCP
915
+ * connection. The default is `65535` bytes. TLS connections use TLS record handling rather than
916
+ * this setting.
917
+ *
918
+ * **Note:** This value does not preserve message boundaries and does not determine IP packet
919
+ * sizes. TCP remains a continuous byte stream.
920
+ */
921
+ sendPacketSize: number
922
+
923
+ /**
924
+ * Returns the accumulated send/receive session log for this wrapper when `KeepSessionLog` is
925
+ * `true`. Use `SessionLogEncoding` to choose an escaped or hexadecimal representation and
926
+ * `ClearSessionLog` to reset it.
927
+ *
928
+ * **Important:** The log can contain sensitive plaintext even when the network connection uses
929
+ * TLS. Treat it as diagnostic data and protect it accordingly.
930
+ *
931
+ * This property is read-only.
932
+ */
933
+ readonly sessionLog: string
934
+
935
+ /**
936
+ * Controls how bytes are rendered in `SessionLog`. The default is `esc`.
937
+ *
938
+ * ValueFormat
939
+ *
940
+ * | `esc` | | Compact C-style escaped text. Printable ASCII remains readable; control and
941
+ * nonprintable bytes are escaped, such as `\r`, `\n`, and `\xHH`. |
942
+ *
943
+ * | `hex` | | Every byte is represented in hexadecimal, which is larger but unambiguous for
944
+ * binary protocols. |
945
+ */
946
+ sessionLogEncoding: string
947
+
948
+ /**
949
+ * Requests the operating-system receive-buffer size for the TCP socket. The default requested
950
+ * value is `4194304` bytes. Most applications should leave it unchanged.
951
+ *
952
+ * **Note:** The operating system may round, clamp, or internally scale the requested value.
953
+ * Increasing the buffer does not by itself guarantee higher throughput; measure performance
954
+ * before changing it.
955
+ */
956
+ soRcvBuf: number
957
+
958
+ /**
959
+ * Controls the `SO_REUSEADDR` option for a socket that will bind and listen. The default is
960
+ * `true`. Set it before `BindAndListen`, `BindAndListenPortRange`, or `InitSslServer`.
961
+ *
962
+ * **Important:** The exact meaning of `SO_REUSEADDR` differs across operating systems. It can
963
+ * help restart a listener after a previous connection, but it is not a portable substitute for
964
+ * exclusive-port ownership.
965
+ */
966
+ soReuseAddr: boolean
967
+
968
+ /**
969
+ * Requests the operating-system send-buffer size for the TCP socket. The default requested value
970
+ * is `262144` bytes. Most applications should leave it unchanged.
971
+ *
972
+ * **Note:** The operating system may round, clamp, or internally scale the value. Test
973
+ * representative workloads before increasing it.
974
+ */
975
+ soSndBuf: number
976
+
977
+ /**
978
+ * Specifies the hostname or numeric IP address of the SOCKS proxy. It is used only when
979
+ * `SocksVersion` is `4` or `5`.
980
+ */
981
+ socksHostname: string
982
+
983
+ /**
984
+ * Specifies the password for SOCKS5 username/password authentication. SOCKS4 does not define a
985
+ * password field, so this property is ignored for SOCKS4.
986
+ *
987
+ * **Important:** SOCKS5 username/password authentication does not itself encrypt credentials.
988
+ * Security depends on the network path to the proxy.
989
+ */
990
+ socksPassword: string
991
+
992
+ /**
993
+ * Specifies the TCP port of the SOCKS proxy. The default is `1080`. It is used only when
994
+ * `SocksVersion` is `4` or `5`.
995
+ */
996
+ socksPort: number
997
+
998
+ /**
999
+ * Specifies the SOCKS proxy username. For SOCKS4 it is the user ID sent in the request; for
1000
+ * SOCKS5 it is used when username/password authentication is negotiated.
1001
+ */
1002
+ socksUsername: string
1003
+
1004
+ /**
1005
+ * Selects whether connections are routed through a SOCKS proxy.
1006
+ *
1007
+ * ValueBehavior
1008
+ *
1009
+ * | 0 | | Do not use a SOCKS proxy. This is the default. |
1010
+ *
1011
+ * | 4 | | Connect through a SOCKS4 proxy. |
1012
+ *
1013
+ * | 5 | | Connect through a SOCKS5 proxy. |
1014
+ */
1015
+ socksVersion: number
1016
+
1017
+ /**
1018
+ * Controls whether incoming connections accepted by this listener must complete a TLS handshake.
1019
+ * The default is `false`. Set it to `true` for a TLS server listener.
1020
+ *
1021
+ * **Important:** This is a listener requirement, not a connection-state indicator. Configure the
1022
+ * server certificate with `InitSslServer` before accepting TLS clients. Do not use `TlsVersion`
1023
+ * or `TlsCipherSuite` alone to determine whether the current connection is protected by TLS,
1024
+ * because those properties retain the results of the object's most recent successful TLS
1025
+ * handshake even after the connection changes.
1026
+ */
1027
+ ssl: boolean
1028
+
1029
+ /**
1030
+ * Restricts the cipher suites permitted for TLS connections. This property has the same behavior
1031
+ * as `Chilkat.Http.SslAllowedCiphers` and applies to TLS client connections and TLS server
1032
+ * handshakes.
1033
+ *
1034
+ * The default empty string allows all cipher suites implemented and enabled by the Chilkat build.
1035
+ * To restrict negotiation, provide a comma-separated list of cipher-suite names in preference
1036
+ * order, for example:
1037
+ *
1038
+ * ```
1039
+ * TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
1040
+ * ```
1041
+ *
1042
+ * The negotiated suite must be in the intersection supported by both peers. A TLS client supplies
1043
+ * its allowed list to the server; the server ultimately chooses from that list.
1044
+ *
1045
+ * The following policy keywords are also recognized:
1046
+ *
1047
+ * - `rsa1024` — when acting as a client, reject a server certificate whose RSA key is smaller
1048
+ * than 1024 bits.
1049
+ *
1050
+ * - `rsa2048` — when acting as a client, reject a server certificate whose RSA key is smaller
1051
+ * than 2048 bits.
1052
+ *
1053
+ * - `secure-renegotiation` — require secure renegotiation.
1054
+ *
1055
+ * - `best-practices` — use Chilkat's current best-practices policy. The exact policy may change
1056
+ * in later Chilkat versions.
1057
+ *
1058
+ * Legacy filter keywords such as `aes256-cbc`, `aes128-cbc`, `3des-cbc`, and `rc4` remain
1059
+ * recognized for compatibility.
1060
+ *
1061
+ * **Security:** Avoid obsolete suites based on RC4, DES, or 3DES. The set of implemented suites
1062
+ * and the meaning of `best-practices` can change with Chilkat versions and platform capabilities.
1063
+ */
1064
+ sslAllowedCiphers: string
1065
+
1066
+ /**
1067
+ * Selects the SSL/TLS protocol version allowed for secure connections. This property has the same
1068
+ * behavior as `Chilkat.Http.SslProtocol` and applies to TLS client connections and TLS server
1069
+ * handshakes.
1070
+ *
1071
+ * Accepted values are:
1072
+ *
1073
+ * - `default`
1074
+ *
1075
+ * - `TLS 1.3`
1076
+ *
1077
+ * - `TLS 1.2`
1078
+ *
1079
+ * - `TLS 1.1`
1080
+ *
1081
+ * - `TLS 1.0`
1082
+ *
1083
+ * - `SSL 3.0`
1084
+ *
1085
+ * - `TLS 1.3 or higher`
1086
+ *
1087
+ * - `TLS 1.2 or higher`
1088
+ *
1089
+ * - `TLS 1.1 or higher`
1090
+ *
1091
+ * - `TLS 1.0 or higher`
1092
+ *
1093
+ * The default value is `default`, which allows the protocol to be selected dynamically according
1094
+ * to what the peer and Chilkat support. Choosing an exact version causes the connection to fail
1095
+ * unless that exact version is negotiated. A minimum-version form such as `TLS 1.2 or higher` is
1096
+ * generally preferable to an exact version.
1097
+ *
1098
+ * **Security:** Avoid SSL 3.0, TLS 1.0, and TLS 1.1 unless compatibility with a legacy peer is
1099
+ * unavoidable.
1100
+ */
1101
+ sslProtocol: string
1102
+
1103
+ /**
1104
+ * Specifies the character encoding used by text-oriented socket methods. Examples include
1105
+ * `utf-8`, `windows-1252`, `shift_jis`, and `iso-8859-1`. The default is `ansi`.
1106
+ *
1107
+ * The value `ansi` means the system default encoding determined by the default system locale. It
1108
+ * is not a fixed encoding such as Windows-1252, ISO-8859-1, or ASCII; the actual encoding is
1109
+ * platform- and system-configuration-dependent.
1110
+ *
1111
+ * Sending methods such as `SendString` and `SendSb` encode text using this charset. String
1112
+ * receive methods decode incoming bytes from this charset, including `ReceiveString`,
1113
+ * `ReceiveSb`, `ReceiveToCRLF`, and delimiter-based string methods.
1114
+ *
1115
+ * **Important:** TCP transports bytes, not text. Both peers must agree on the encoding and
1116
+ * message framing. For portable protocols, prefer an explicit charset such as `utf-8` rather than
1117
+ * `ansi`. Use byte-oriented methods when the protocol is binary or exact byte preservation is
1118
+ * required.
1119
+ */
1120
+ stringCharset: string
1121
+
1122
+ /**
1123
+ * Controls the `TCP_NODELAY` option. The default is `false`, allowing the Nagle algorithm. Set it
1124
+ * to `true` to send small writes with lower latency rather than waiting to coalesce them.
1125
+ *
1126
+ * **Note:** Disabling Nagle can improve interactive request/response latency but may increase
1127
+ * packet overhead. It is not universally faster for bulk transfers.
1128
+ */
1129
+ tcpNoDelay: boolean
1130
+
1131
+ /**
1132
+ * Returns the cipher suite from the most recent successful TLS handshake performed by this
1133
+ * `Socket` object, for example `TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384`. It is empty until the
1134
+ * object has completed its first successful TLS handshake.
1135
+ *
1136
+ * **Cached handshake result:**
1137
+ * This property does not necessarily describe the current connection. Its value is retained after
1138
+ * `Close`, a failed connection attempt, a later plain-TCP connection, and `ConvertFromSsl`. It is
1139
+ * replaced only when this object completes another successful TLS handshake. Do not use this
1140
+ * property alone to determine whether the current connection is protected by TLS.
1141
+ *
1142
+ * This property is read-only.
1143
+ */
1144
+ readonly tlsCipherSuite: string
1145
+
1146
+ /**
1147
+ * Specifies one or more expected SubjectPublicKeyInfo (SPKI) fingerprints for TLS public-key
1148
+ * pinning. If the certificate presented by the server does not match any configured fingerprint,
1149
+ * the TLS handshake is aborted and the connection fails.
1150
+ *
1151
+ * The format is:
1152
+ *
1153
+ * ```
1154
+ * hash_algorithm, encoding, fingerprint1, fingerprint2, ...
1155
+ * ```
1156
+ *
1157
+ * For example, a single SHA-256 base64 pin is:
1158
+ *
1159
+ * ```
1160
+ * sha256, base64, lKg1SIqyhPSK19tlPbjl8s02yChsVTDklQpkMCHvsTE=
1161
+ * ```
1162
+ *
1163
+ * Supported hash algorithms include `sha1`, `sha256`, `sha384`, `sha512`, `md2`, `md5`, `haval`,
1164
+ * `ripemd128`, `ripemd160`, `ripemd256`, and `ripemd320`. Supported encodings include `base64`,
1165
+ * `hex`, and other Chilkat-supported binary encodings.
1166
+ *
1167
+ * **Independent enforcement:** Pin matching is enforced whenever this property is nonempty, even
1168
+ * if `RequireSslCertVerify` is `false`. Normal certificate validity and trust-chain verification
1169
+ * remain separately controlled by `RequireSslCertVerify`.
1170
+ *
1171
+ * **Key rotation:** Pinning is operationally strict. Add backup pins before rotating the server
1172
+ * key, or a legitimate certificate replacement can break connectivity.
1173
+ */
1174
+ tlsPinSet: string
1175
+
1176
+ /**
1177
+ * Returns the protocol version from the most recent successful TLS handshake performed by this
1178
+ * `Socket` object, such as `TLS 1.2` or `TLS 1.3`. It is empty until the object has completed its
1179
+ * first successful TLS handshake.
1180
+ *
1181
+ * **Cached handshake result:**
1182
+ * This property does not necessarily describe the current connection. Its value is retained after
1183
+ * `Close`, a failed connection attempt, a later plain-TCP connection, and `ConvertFromSsl`. It is
1184
+ * replaced only when this object completes another successful TLS handshake. Do not use this
1185
+ * property alone to determine whether the current connection is protected by TLS.
1186
+ *
1187
+ * This property is read-only.
1188
+ */
1189
+ readonly tlsVersion: string
1190
+
1191
+ /**
1192
+ * Stores arbitrary application text with the socket object. Chilkat does not transmit, interpret,
1193
+ * or otherwise use this value. It is useful for associating a label, connection ID, or other
1194
+ * application metadata with a socket.
1195
+ */
1196
+ userData: string
1197
+
1198
+ /**
1199
+ * Returns the port on which the socket is listening. This is especially useful after calling
1200
+ * `BindAndListen` with port `0`, which asks the operating system to select an available port.
1201
+ *
1202
+ * This property is read-only.
1203
+ */
1204
+ readonly listenPort: number
1205
+
1206
+ /**
1207
+ * Set this property to `true` when the proxied connection will carry HTTP requests, such as when
1208
+ * a `Rest` object uses this socket through `UseConnection`. The default is `false`.
1209
+ *
1210
+ * An HTTP client can communicate with a proxy differently from a non-HTTP protocol. For example,
1211
+ * plain HTTP commonly sends an absolute request URI to the proxy, whereas other protocols
1212
+ * generally require an HTTP `CONNECT` tunnel.
1213
+ *
1214
+ * **Important:** Set this before connecting through the HTTP proxy. An incorrect value can
1215
+ * produce a connection that is established using the wrong proxy mode for the application
1216
+ * protocol.
1217
+ */
1218
+ httpProxyForHttp: boolean
1219
+
1220
+ /**
1221
+ * Returns the average raw receive rate, in bytes per second, since receive performance
1222
+ * measurement began or was last reset. The measurement includes TLS or SSH framing overhead. Call
1223
+ * `ResetPerf` with `true` to restart receive measurement.
1224
+ *
1225
+ * This property is read-only.
1226
+ */
1227
+ readonly rcvBytesPerSec: number
1228
+
1229
+ /**
1230
+ * Returns the average raw send rate, in bytes per second, since send performance measurement
1231
+ * began or was last reset. The measurement includes TLS or SSH framing overhead. Call `ResetPerf`
1232
+ * with `false` to restart send measurement.
1233
+ *
1234
+ * This property is read-only.
1235
+ */
1236
+ readonly sendBytesPerSec: number
1237
+
1238
+ /**
1239
+ * Provides comma-separated compatibility or platform-specific options. The default is the empty
1240
+ * string and should normally remain unchanged.
1241
+ *
1242
+ * KeywordBehavior
1243
+ *
1244
+ * | `ProtectFromVpn` | | On Android, attempts to route the socket outside an active VPN. |
1245
+ *
1246
+ * | `EnableTls13` | | Historical compatibility option introduced when TLS 1.3 was not yet enabled
1247
+ * by default. It is generally unnecessary in current versions. |
1248
+ *
1249
+ * **Important:** These options are intentionally uncommon and may be platform- or
1250
+ * version-specific. Use only when the documented behavior is required.
1251
+ */
1252
+ uncommonOptions: string
1253
+
1254
+ /**
1255
+ * Specifies the application-layer protocol name offered in the TLS ALPN extension, such as `h2`
1256
+ * or `http/1.1`. Leave it empty when ALPN is not required.
1257
+ *
1258
+ * **Note:** ALPN negotiation does not implement the selected application protocol. The
1259
+ * application must still speak that protocol over the established TLS connection.
1260
+ */
1261
+ alpnProtocol: string
1262
+
1263
+ /**
1264
+ * Sets the Server Name Indication (SNI) hostname sent in the TLS ClientHello. By default, Chilkat
1265
+ * uses the hostname passed to `Connect`. Set this property when connecting to a numeric IP
1266
+ * address or alternate network endpoint while the TLS server expects a particular virtual-host
1267
+ * name.
1268
+ *
1269
+ * **Scope:** This property changes only the SNI name in the TLS handshake. It does not change the
1270
+ * DNS lookup, TCP destination, or any hostname carried by the application protocol.
1271
+ */
1272
+ sniHostname: string
1273
+
1274
+ /**
1275
+ * Returns the number of bytes immediately available to the socket layer without waiting. On a TLS
1276
+ * connection, the value can include encrypted TLS record overhead and therefore does not
1277
+ * necessarily equal the amount of application plaintext available.
1278
+ *
1279
+ * **Important:** Do not use this value as a message length. TCP is a byte stream, and a complete
1280
+ * application message can arrive in multiple reads or multiple messages can be available
1281
+ * together.
1282
+ *
1283
+ * This property is read-only.
1284
+ */
1285
+ readonly numBytesAvailable: number
1286
+
1287
+ // ---- Methods ----
1288
+
1289
+ /**
1290
+ * Adds a certificate-authority distinguished name to the list advertised by a TLS server when
1291
+ * requesting a client certificate for mutual TLS. Call this method once for each acceptable CA
1292
+ * distinguished name.
1293
+ *
1294
+ * **Required order:** Call every `AddSslAcceptableClientCaDn` before `InitSslServer`. The
1295
+ * acceptable-CA list is captured when `InitSslServer` creates the TLS server configuration. Names
1296
+ * added afterward are not included in that configuration's CertificateRequest and therefore do
1297
+ * not affect its handshakes.
1298
+ *
1299
+ * Skip this method when the server does not request client certificates. If no CA distinguished
1300
+ * names are added, client certificates issued by any root CA are accepted by this CA-name filter.
1301
+ *
1302
+ * **Authorization remains application-defined:** The CA-name list is only one part of mutual TLS.
1303
+ * After `AcceptNext` succeeds, inspect the client certificates on the accepted socket and apply
1304
+ * the application's authorization policy.
1305
+ *
1306
+ * @throws Error if the call fails (the message names the reason); the full log is in
1307
+ * {@link Socket.lastErrorText}.
1308
+ */
1309
+ addSslAcceptableClientCaDn(certAuthDN: string): void
1310
+
1311
+ /**
1312
+ * Binds a TCP listener to `port` and places it into listening mode. After this method succeeds,
1313
+ * call `AcceptNext` to accept incoming connections.
1314
+ *
1315
+ * When `ClientIpAddress` is empty, the listener binds to all interfaces: `0.0.0.0` when the
1316
+ * shared `ListenIpv6`/`PreferIpv6` setting is `false`, or `::` when it is `true`. To restrict the
1317
+ * listener to one local interface, set `ClientIpAddress` to that interface's numeric address
1318
+ * before calling this method. The explicit address also determines whether the listener is IPv4
1319
+ * or IPv6.
1320
+ *
1321
+ * `backLog` is the requested operating-system queue length for connections that have completed or
1322
+ * are completing the TCP handshake but have not yet been accepted. It is a queue hint, not a
1323
+ * limit on the total number of clients the application can serve.
1324
+ *
1325
+ * Pass `0` for `port` to let the operating system choose an available port, then read
1326
+ * `ListenPort`.
1327
+ *
1328
+ * **Remote access by default:** Because an empty `ClientIpAddress` binds to all interfaces,
1329
+ * remote computers can connect by default, subject to routing and firewall rules. Set
1330
+ * `ClientIpAddress` to `127.0.0.1` or `::1` for a loopback-only listener.
1331
+ *
1332
+ * **State replacement:** If this object currently has an outbound connection, that connection is
1333
+ * discarded and the object becomes a listener. A prior call to `Close` is not required. If
1334
+ * another operation is actively using the socket, this call fails with an in-use error.
1335
+ *
1336
+ * **TLS server call order:** When client-certificate CA names are needed, call
1337
+ * `AddSslAcceptableClientCaDn` first. Then call `InitSslServer`, `BindAndListen`, and
1338
+ * `AcceptNext`, in that order. Calling `InitSslServer` after binding discards the listener and
1339
+ * leaves the object unbound.
1340
+ *
1341
+ * **Backlog:** The operating system may cap or adjust the requested backlog. Choose a value based
1342
+ * on burst arrival rate and how quickly the application returns to accepting connections.
1343
+ *
1344
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
1345
+ * {@link Socket.bindAndListenAsync}.
1346
+ *
1347
+ * @throws Error if the call fails (the message names the reason); the full log is in
1348
+ * {@link Socket.lastErrorText}.
1349
+ */
1350
+ bindAndListen(port: number, backLog: number): void
1351
+
1352
+ /**
1353
+ * Asynchronous form of {@link Socket.bindAndListen}: the same call on a native worker thread,
1354
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
1355
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
1356
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
1357
+ *
1358
+ * The promise rejects with an Error if the call fails; the full log is in
1359
+ * {@link Socket.lastErrorText}.
1360
+ */
1361
+ bindAndListenAsync(port: number, backLog: number): Promise<void>
1362
+
1363
+ /**
1364
+ * Builds and returns a simple HTTP `GET` request for `url`. The method only constructs the
1365
+ * request text; it does not connect, send the request, follow redirects, or read a response.
1366
+ *
1367
+ * **Tip:** Use the higher-level `Http` or `Rest` class for normal HTTP work. This helper is
1368
+ * intended for low-level socket examples or custom HTTP handling.
1369
+ *
1370
+ * @throws Error if the call fails (the message names the reason); the full log is in
1371
+ * {@link Socket.lastErrorText}.
1372
+ */
1373
+ buildHttpGetRequest(url: string): string
1374
+
1375
+ /**
1376
+ * Waits for the connected socket to become writable.
1377
+ *
1378
+ * - `maxWaitMs = 0` performs a nonblocking poll and returns immediately.
1379
+ *
1380
+ * - A positive value waits up to that many milliseconds.
1381
+ *
1382
+ * - Negative values have no defined meaning and should not be used.
1383
+ *
1384
+ * Return valueMeaning
1385
+ *
1386
+ * | 1 | | The socket is connected and currently writable. |
1387
+ *
1388
+ * | 0 | | The socket was not writable before the timeout, or the operation was aborted. |
1389
+ *
1390
+ * | -1 | | The socket is not connected or an error occurred. |
1391
+ *
1392
+ * **Write readiness:**
1393
+ * Writable means the operating system can presently accept more bytes into its
1394
+ * send buffer. It does not mean the remote application has received or
1395
+ * processed them.
1396
+ *
1397
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
1398
+ * {@link Socket.checkWriteableAsync}.
1399
+ */
1400
+ checkWriteable(maxWaitMs: number): number
1401
+
1402
+ /**
1403
+ * Asynchronous form of {@link Socket.checkWriteable}: the same call on a native worker thread,
1404
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
1405
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
1406
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
1407
+ */
1408
+ checkWriteableAsync(maxWaitMs: number): Promise<number>
1409
+
1410
+ /**
1411
+ * Clears the accumulated text returned by `SessionLog` for this wrapper. It does not change
1412
+ * `KeepSessionLog` or close the connection.
1413
+ */
1414
+ clearSessionLog(): void
1415
+
1416
+ /**
1417
+ * Attempts to gracefully terminate and close the current TCP, TLS, or SSH channel connection.
1418
+ * `maxWaitMs` controls how long the method waits for clean shutdown processing.
1419
+ *
1420
+ * - `0` waits indefinitely for the clean close.
1421
+ *
1422
+ * - A positive value waits up to that many milliseconds.
1423
+ *
1424
+ * - Negative values have no defined meaning and should not be used.
1425
+ *
1426
+ * The method is safe and idempotent. Calling it on an already closed or never-connected object
1427
+ * does nothing and returns `true`. Repeated calls are harmless; the diagnostic log may note that
1428
+ * there was no connection to close.
1429
+ *
1430
+ * **Socket-set removal:** When a socket-set selector is active, `Close` is routed to the selected
1431
+ * member, closes it, and removes it from the set immediately. There is no separate
1432
+ * remove-without-closing method. Direct `SelectorIndex` positions after the removed member shift
1433
+ * down.
1434
+ *
1435
+ * **Duplicated connections:** When the connection is shared by objects created through
1436
+ * `DupSocket`, calling `Close` on any wrapper closes the connection for all wrappers. Merely
1437
+ * destroying one duplicate without calling `Close` releases only that wrapper's reference.
1438
+ *
1439
+ * **Note:** After this call, `IsConnected` is `false` for the closed connection. A graceful
1440
+ * transport close cannot guarantee that the remote application processed all data sent before the
1441
+ * close.
1442
+ *
1443
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
1444
+ * {@link Socket.closeAsync}.
1445
+ *
1446
+ * @throws Error if the call fails (the message names the reason); the full log is in
1447
+ * {@link Socket.lastErrorText}.
1448
+ */
1449
+ close(maxWaitMs: number): void
1450
+
1451
+ /**
1452
+ * Asynchronous form of {@link Socket.close}: the same call on a native worker thread,
1453
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
1454
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
1455
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
1456
+ *
1457
+ * The promise rejects with an Error if the call fails; the full log is in
1458
+ * {@link Socket.lastErrorText}.
1459
+ */
1460
+ closeAsync(maxWaitMs: number): Promise<void>
1461
+
1462
+ /**
1463
+ * Establishes a TCP connection to `hostname`:`port`. Set
1464
+ * `ssl` to `true` to perform a TLS handshake after the TCP connection
1465
+ * succeeds; set it to `false` for plain TCP. `hostname` may be a DNS
1466
+ * name or a numeric IPv4 or IPv6 address.
1467
+ *
1468
+ * `maxWaitMs` is the overall wait budget for DNS resolution performed
1469
+ * by this call and establishment of the TCP connection. Its special values are:
1470
+ *
1471
+ * - `0` waits indefinitely, subject to an internal effective ceiling of approximately six hours.
1472
+ *
1473
+ * - A positive value below `100` milliseconds is treated as `100` milliseconds.
1474
+ *
1475
+ * - Negative values have no defined meaning and should not be used.
1476
+ *
1477
+ * The later TLS handshake is governed by `MaxReadIdleMs` and
1478
+ * `MaxSendIdleMs`, not by `maxWaitMs`. HTTP and SOCKS proxy
1479
+ * protocol exchanges ordinarily use those read/write idle timeouts as well;
1480
+ * there is no separate proxy-negotiation timeout property.
1481
+ *
1482
+ * Connection options such as `ClientIpAddress`,
1483
+ * `ClientPort`, proxy settings, `PreferIpv6`, TLS policy,
1484
+ * SNI, ALPN, certificate verification, pinning, and client certificates must be
1485
+ * configured before calling this method.
1486
+ *
1487
+ * Connection phaseTimeout
1488
+ *
1489
+ * | DNS resolution performed by `Connect` | | `maxWaitMs` overall budget |
1490
+ *
1491
+ * | TCP connection establishment | | `maxWaitMs` |
1492
+ *
1493
+ * | TLS handshake | | `MaxReadIdleMs` and `MaxSendIdleMs` |
1494
+ *
1495
+ * | HTTP/SOCKS proxy exchanges | | Ordinarily the read/write idle timeouts; no separate setting
1496
+ * is provided |
1497
+ *
1498
+ * **Reusing the object:**
1499
+ * A prior call to `Close` is not required. If this object is already
1500
+ * connected, listening, or contains leftover state from a failed connection or
1501
+ * TLS upgrade, `Connect` discards that state and establishes the new
1502
+ * connection. An existing TCP or TLS connection is torn down immediately rather
1503
+ * than closed gracefully, and an existing listener is stopped. If another
1504
+ * operation is actively using the socket, the call fails with an in-use error
1505
+ * instead of interrupting that operation.
1506
+ *
1507
+ * **SSH tunnel exception:**
1508
+ * When this object has a live SSH tunnel, the SSH session is preserved. The
1509
+ * previous tunneled channel is closed, and the new destination connection is
1510
+ * opened through the same SSH tunnel.
1511
+ *
1512
+ * **Socket sets:**
1513
+ * If `SelectorIndex`, `SelectorReadIndex`, or
1514
+ * `SelectorWriteIndex` selects a member, this method is routed to that
1515
+ * selected member. With no active selector, it creates or replaces the set
1516
+ * container object's own direct connection and leaves the contained members
1517
+ * unchanged.
1518
+ *
1519
+ * **Security:**
1520
+ * A successful TCP connection only establishes a byte stream. For TLS, enable
1521
+ * the certificate-verification and/or pinning policy required by the
1522
+ * application. A completed connection does not by itself authenticate an
1523
+ * application-level protocol.
1524
+ *
1525
+ * **Idle connections:**
1526
+ * A connected socket does not automatically close merely because no application
1527
+ * data is sent. Peers, NAT devices, proxies, firewalls, and operating-system TCP
1528
+ * keepalive policies can still close an idle path.
1529
+ *
1530
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
1531
+ * {@link Socket.connectAsync}.
1532
+ *
1533
+ * @throws Error if the call fails (the message names the reason); the full log is in
1534
+ * {@link Socket.lastErrorText}.
1535
+ */
1536
+ connect(hostname: string, port: number, ssl: boolean, maxWaitMs: number): void
1537
+
1538
+ /**
1539
+ * Asynchronous form of {@link Socket.connect}: the same call on a native worker thread,
1540
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
1541
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
1542
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
1543
+ *
1544
+ * The promise rejects with an Error if the call fails; the full log is in
1545
+ * {@link Socket.lastErrorText}.
1546
+ */
1547
+ connectAsync(hostname: string, port: number, ssl: boolean, maxWaitMs: number): Promise<void>
1548
+
1549
+ /**
1550
+ * Ends the TLS layer while leaving the underlying TCP connection open for
1551
+ * subsequent unencrypted communication. This is the reverse of a STARTTLS-style
1552
+ * upgrade and is valid only when TLS is currently active.
1553
+ *
1554
+ * If called on a connected plain TCP socket, the method returns `false` because
1555
+ * there is no TLS layer to remove. The plain connection remains unchanged.
1556
+ *
1557
+ * **Important:**
1558
+ * The peer and application protocol must explicitly support returning to
1559
+ * plaintext. Arbitrarily removing TLS from a normal secure protocol will usually
1560
+ * break the session and can expose data.
1561
+ *
1562
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
1563
+ * {@link Socket.convertFromSslAsync}.
1564
+ *
1565
+ * @throws Error if the call fails (the message names the reason); the full log is in
1566
+ * {@link Socket.lastErrorText}.
1567
+ */
1568
+ convertFromSsl(): void
1569
+
1570
+ /**
1571
+ * Asynchronous form of {@link Socket.convertFromSsl}: the same call on a native worker thread,
1572
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
1573
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
1574
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
1575
+ *
1576
+ * The promise rejects with an Error if the call fails; the full log is in
1577
+ * {@link Socket.lastErrorText}.
1578
+ */
1579
+ convertFromSslAsync(): Promise<void>
1580
+
1581
+ /**
1582
+ * Upgrades an already connected plain TCP socket to TLS by performing a
1583
+ * client-side TLS handshake over the existing connection.
1584
+ *
1585
+ * **Important:**
1586
+ * Use this only at the point where the application protocol permits a
1587
+ * STARTTLS-style upgrade. Configure TLS policy, SNI, certificate verification,
1588
+ * pinning, and any client certificate before calling it.
1589
+ *
1590
+ * **Already-TLS connections:**
1591
+ * Calling `ConvertToSsl` on a connection that is already protected by
1592
+ * TLS is unsupported. The method checks that a connection exists but does not
1593
+ * define a second TLS-upgrade operation. Call it only for an established plain
1594
+ * connection.
1595
+ *
1596
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
1597
+ * {@link Socket.convertToSslAsync}.
1598
+ *
1599
+ * @throws Error if the call fails (the message names the reason); the full log is in
1600
+ * {@link Socket.lastErrorText}.
1601
+ */
1602
+ convertToSsl(): void
1603
+
1604
+ /**
1605
+ * Asynchronous form of {@link Socket.convertToSsl}: the same call on a native worker thread,
1606
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
1607
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
1608
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
1609
+ *
1610
+ * The promise rejects with an Error if the call fails; the full log is in
1611
+ * {@link Socket.lastErrorText}.
1612
+ */
1613
+ convertToSslAsync(): Promise<void>
1614
+
1615
+ /**
1616
+ * Clears Chilkat's process-wide in-memory DNS cache. Subsequent hostname resolutions perform a
1617
+ * new lookup as needed.
1618
+ *
1619
+ * **Important:** The cache is shared by Chilkat objects in the process, so clearing it can affect
1620
+ * unrelated connections. Normally the cache should be left intact because Chilkat observes DNS
1621
+ * record TTL expiration.
1622
+ */
1623
+ dnsCacheClear(): void
1624
+
1625
+ /**
1626
+ * Resolves `hostname` and returns one numeric IP address.
1627
+ *
1628
+ * - `maxWaitMs = 0` waits indefinitely.
1629
+ *
1630
+ * - A positive value waits up to that many milliseconds.
1631
+ *
1632
+ * - Negative values have no defined meaning and should not be used.
1633
+ *
1634
+ * **Multiple addresses:**
1635
+ * A hostname can resolve to multiple IPv4 and IPv6 addresses. This method
1636
+ * returns one selected address, influenced by settings such as
1637
+ * `PreferIpv6`; it is not a complete DNS-record enumeration.
1638
+ *
1639
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
1640
+ * {@link Socket.dnsLookupAsync}.
1641
+ *
1642
+ * @throws Error if the call fails (the message names the reason); the full log is in
1643
+ * {@link Socket.lastErrorText}.
1644
+ */
1645
+ dnsLookup(hostname: string, maxWaitMs: number): string
1646
+
1647
+ /**
1648
+ * Asynchronous form of {@link Socket.dnsLookup}: the same call on a native worker thread,
1649
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
1650
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
1651
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
1652
+ *
1653
+ * The promise rejects with an Error if the call fails; the full log is in
1654
+ * {@link Socket.lastErrorText}.
1655
+ */
1656
+ dnsLookupAsync(hostname: string, maxWaitMs: number): Promise<string>
1657
+
1658
+ /**
1659
+ * Returns the certificate-authority distinguished name at zero-based `index` from the list sent
1660
+ * by a TLS server when it requests a client certificate. Valid indexes range from `0` through
1661
+ * `NumSslAcceptableClientCAs - 1`.
1662
+ *
1663
+ * @throws Error if the call fails (the message names the reason); the full log is in
1664
+ * {@link Socket.lastErrorText}.
1665
+ */
1666
+ getSslAcceptableClientCaDn(index: number): string
1667
+
1668
+ /**
1669
+ * Configures this object for server-side TLS using `cert` as the server certificate. The
1670
+ * certificate must have access to its corresponding private key.
1671
+ *
1672
+ * For a TLS listener that requests client certificates, the required sequence is:
1673
+ *
1674
+ * ```
1675
+ * AddSslAcceptableClientCaDn (once for each acceptable CA)
1676
+ * InitSslServer
1677
+ * BindAndListen
1678
+ * AcceptNext
1679
+ * ```
1680
+ *
1681
+ * For a TLS listener without client-certificate requests, omit `AddSslAcceptableClientCaDn`. For
1682
+ * a plain non-TLS listener, omit both TLS setup steps.
1683
+ *
1684
+ * When the object is not already connected, this method also sets `Ssl` to `true`. It may also be
1685
+ * used on an already connected socket to begin server-side TLS on that live connection.
1686
+ *
1687
+ * **Call order:** Do not call `InitSslServer` after `BindAndListen`. A listening socket is not
1688
+ * treated as a connected socket, so this method replaces it with a new, unbound TLS-server socket
1689
+ * and the existing bind is lost. All calls to `AddSslAcceptableClientCaDn` must also occur before
1690
+ * this method.
1691
+ *
1692
+ * **Listener versus accepted socket:** The server certificate configuration remains on the
1693
+ * listener and is used for each accepted TLS handshake. Per-connection negotiated TLS information
1694
+ * and received client certificates are stored on the accepted socket.
1695
+ *
1696
+ * @throws Error if the call fails (the message names the reason); the full log is in
1697
+ * {@link Socket.lastErrorText}.
1698
+ */
1699
+ initSslServer(cert: Cert): void
1700
+
1701
+ /**
1702
+ * Performs a nonblocking check for readable activity on the socket. It returns `true` when data
1703
+ * or another read-ready condition is present and `false` when nothing is immediately available.
1704
+ *
1705
+ * **Note:** A socket can become read-ready because the peer closed or reset the connection. The
1706
+ * next receive operation determines whether bytes are available or the connection ended.
1707
+ *
1708
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
1709
+ * {@link Socket.pollDataAvailableAsync}.
1710
+ */
1711
+ pollDataAvailable(): boolean
1712
+
1713
+ /**
1714
+ * Asynchronous form of {@link Socket.pollDataAvailable}: the same call on a native worker thread,
1715
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
1716
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
1717
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
1718
+ */
1719
+ pollDataAvailableAsync(): Promise<boolean>
1720
+
1721
+ /**
1722
+ * Reads exactly one byte from the connection and stores its numeric value in `ReceivedInt`. If
1723
+ * `bUnsigned` is `true`, the result is in the range `0` through `255`; otherwise it is
1724
+ * interpreted as a signed two's-complement byte in the range `-128` through `127`.
1725
+ *
1726
+ * The method waits according to `MaxReadIdleMs` and returns `false` on timeout, closure, or
1727
+ * another receive failure. On failure, `ReceivedInt` is not cleared or changed; it retains the
1728
+ * value from the last successful integer receive.
1729
+ *
1730
+ * **Check the return value:** Use this method's Boolean result to determine whether `ReceivedInt`
1731
+ * contains a newly received byte.
1732
+ *
1733
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
1734
+ * {@link Socket.receiveByteAsync}.
1735
+ *
1736
+ * @throws Error if the call fails (the message names the reason); the full log is in
1737
+ * {@link Socket.lastErrorText}.
1738
+ */
1739
+ receiveByte(bUnsigned: boolean): void
1740
+
1741
+ /**
1742
+ * Asynchronous form of {@link Socket.receiveByte}: the same call on a native worker thread,
1743
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
1744
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
1745
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
1746
+ *
1747
+ * The promise rejects with an Error if the call fails; the full log is in
1748
+ * {@link Socket.lastErrorText}.
1749
+ */
1750
+ receiveByteAsync(bUnsigned: boolean): Promise<void>
1751
+
1752
+ /**
1753
+ * Receives binary data and returns one delivery encoded as text using
1754
+ * `encodingAlg`. Chilkat first returns any data already buffered
1755
+ * internally. If no buffered data exists, the method performs one receive
1756
+ * operation; it does not loop to drain everything that may be available.
1757
+ *
1758
+ * -
1759
+ * For plain TCP, a direct read returns at most
1760
+ * `ReceivePacketSize` bytes.
1761
+ *
1762
+ * -
1763
+ * For TLS or SSH, the returned amount is governed by the TLS record or SSH
1764
+ * packet rather than `ReceivePacketSize`.
1765
+ *
1766
+ * -
1767
+ * Already-buffered data is returned in full, even if it exceeds
1768
+ * `ReceivePacketSize`.
1769
+ *
1770
+ * -
1771
+ * A successful call can receive zero bytes during TLS renegotiation, producing
1772
+ * an empty encoded result. Treat this as no application data yet and call the
1773
+ * receive method again.
1774
+ *
1775
+ * Common encoding names include `base64`, `modBase64`,
1776
+ * `base32`, `uu`, `qp`, `url`,
1777
+ * `hex`, `q`, `b`, `url_oauth`,
1778
+ * `url_rfc1738`, `url_rfc2396`, and
1779
+ * `url_rfc3986`. See
1780
+ * [all supported
1781
+ * Chilkat binary encodings](https://cknotes.com/chilkat-binary-encoding-list/).
1782
+ *
1783
+ * **Inspect the result even on failure:**
1784
+ * An orderly peer close reports `ReceiveFailReason = 10`, but the
1785
+ * returned encoded string may contain final bytes received immediately before
1786
+ * the close. Process those bytes before finishing the receive loop.
1787
+ *
1788
+ * **Encoding:**
1789
+ * The encoding affects only the textual representation returned by this method.
1790
+ * It does not change the bytes received from the network.
1791
+ *
1792
+ * **TCP framing:**
1793
+ * TCP does not preserve message boundaries. Define framing in the application
1794
+ * protocol, such as an exact length, delimiter, fixed-size record, or connection
1795
+ * close.
1796
+ *
1797
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
1798
+ * {@link Socket.receiveBytesENCAsync}.
1799
+ *
1800
+ * @throws Error if the call fails (the message names the reason); the full log is in
1801
+ * {@link Socket.lastErrorText}.
1802
+ */
1803
+ receiveBytesENC(encodingAlg: string): string
1804
+
1805
+ /**
1806
+ * Asynchronous form of {@link Socket.receiveBytesENC}: the same call on a native worker thread,
1807
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
1808
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
1809
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
1810
+ *
1811
+ * The promise rejects with an Error if the call fails; the full log is in
1812
+ * {@link Socket.lastErrorText}.
1813
+ */
1814
+ receiveBytesENCAsync(encodingAlg: string): Promise<string>
1815
+
1816
+ /**
1817
+ * Receives one available block of bytes and appends it to the file named by
1818
+ * `appendFilename`. If Chilkat already has buffered data, that data is
1819
+ * used first. Otherwise, the method performs one receive operation; it does not
1820
+ * loop until the peer closes or until an entire file has arrived. If no data is
1821
+ * immediately available, it waits according to `MaxReadIdleMs`.
1822
+ *
1823
+ * **The file is appended to, not replaced:**
1824
+ * Existing file content is preserved and newly received bytes are written at the
1825
+ * end of the file.
1826
+ *
1827
+ * **Failure and partial-file behavior:**
1828
+ * A network receive failure leaves the file unchanged. However, if the network
1829
+ * read succeeds and a later file-writing error occurs, such as a disk-full or
1830
+ * other filesystem error, the file may contain a partially written block. Bytes
1831
+ * consumed by the receive are included in `ReceivedCount` even when
1832
+ * the overall method fails.
1833
+ *
1834
+ * After a timeout or application abort, the connection is generally still open.
1835
+ * After a peer close or reset, the connection is no longer usable for I/O.
1836
+ *
1837
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
1838
+ * {@link Socket.receiveBytesToFileAsync}.
1839
+ *
1840
+ * @throws Error if the call fails (the message names the reason); the full log is in
1841
+ * {@link Socket.lastErrorText}.
1842
+ */
1843
+ receiveBytesToFile(appendFilename: string): void
1844
+
1845
+ /**
1846
+ * Asynchronous form of {@link Socket.receiveBytesToFile}: the same call on a native worker
1847
+ * thread,
1848
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
1849
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
1850
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
1851
+ *
1852
+ * The promise rejects with an Error if the call fails; the full log is in
1853
+ * {@link Socket.lastErrorText}.
1854
+ */
1855
+ receiveBytesToFileAsync(appendFilename: string): Promise<void>
1856
+
1857
+ /**
1858
+ * Reads exactly four bytes and interprets them as a signed 32-bit two's-complement integer. Byte
1859
+ * order is controlled by `BigEndian`, whose default is `true` for network byte order.
1860
+ *
1861
+ * Negative values are returned unchanged, with one exception: `-1` is reserved as the failure
1862
+ * result. If the incoming four-byte value is `0xFFFFFFFF`, the method deliberately reports
1863
+ * failure, sets `LastMethodFailed`, and returns `-1`. A legitimately transmitted value of `-1`
1864
+ * therefore cannot be received as ordinary data. There is no unsigned variant, so wire values
1865
+ * from `0x80000000` through `0xFFFFFFFE` are returned as negative signed integers.
1866
+ *
1867
+ * **Partial integer reads:** If the operation fails after receiving only part of the four-byte
1868
+ * value, those bytes are consumed and discarded. They cannot be recovered by a later receive
1869
+ * call, and the protocol stream may now be misaligned.
1870
+ *
1871
+ * **Round-trip rule:** `SendCount(N)` followed by `ReceiveCount` round-trips every signed 32-bit
1872
+ * value except `-1`.
1873
+ *
1874
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
1875
+ * {@link Socket.receiveCountAsync}.
1876
+ */
1877
+ receiveCount(): number
1878
+
1879
+ /**
1880
+ * Asynchronous form of {@link Socket.receiveCount}: the same call on a native worker thread,
1881
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
1882
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
1883
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
1884
+ */
1885
+ receiveCountAsync(): Promise<number>
1886
+
1887
+ /**
1888
+ * Reads exactly two bytes, interprets them as a two's-complement integer, and stores the result
1889
+ * in `ReceivedInt`. Set `bigEndian` to `true` for network byte order or `false` for little-endian
1890
+ * order. Set `bUnsigned` to `true` for a value from `0` through `65535`; otherwise the result
1891
+ * ranges from `-32768` through `32767`.
1892
+ *
1893
+ * **Partial integer reads:** If the operation fails after receiving only part of the two-byte
1894
+ * value, the partial bytes are consumed and discarded. They are not retained for a later receive,
1895
+ * and the protocol stream may now be misaligned. `ReceivedInt` remains unchanged on failure, so
1896
+ * use the Boolean return value before reading it.
1897
+ *
1898
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
1899
+ * {@link Socket.receiveInt16Async}.
1900
+ *
1901
+ * @throws Error if the call fails (the message names the reason); the full log is in
1902
+ * {@link Socket.lastErrorText}.
1903
+ */
1904
+ receiveInt16(bigEndian: boolean, bUnsigned: boolean): void
1905
+
1906
+ /**
1907
+ * Asynchronous form of {@link Socket.receiveInt16}: the same call on a native worker thread,
1908
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
1909
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
1910
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
1911
+ *
1912
+ * The promise rejects with an Error if the call fails; the full log is in
1913
+ * {@link Socket.lastErrorText}.
1914
+ */
1915
+ receiveInt16Async(bigEndian: boolean, bUnsigned: boolean): Promise<void>
1916
+
1917
+ /**
1918
+ * Reads exactly four bytes, interprets them as a signed two's-complement integer, and stores the
1919
+ * result in `ReceivedInt`. Set `bigEndian` to `true` for network byte order or `false` for
1920
+ * little-endian order.
1921
+ *
1922
+ * **Partial integer reads:** If the operation fails after receiving only part of the four-byte
1923
+ * value, the partial bytes are consumed and discarded. They are not retained for a later receive,
1924
+ * and the protocol stream may now be misaligned. `ReceivedInt` remains unchanged on failure, so
1925
+ * use the Boolean return value before reading it.
1926
+ *
1927
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
1928
+ * {@link Socket.receiveInt32Async}.
1929
+ *
1930
+ * @throws Error if the call fails (the message names the reason); the full log is in
1931
+ * {@link Socket.lastErrorText}.
1932
+ */
1933
+ receiveInt32(bigEndian: boolean): void
1934
+
1935
+ /**
1936
+ * Asynchronous form of {@link Socket.receiveInt32}: the same call on a native worker thread,
1937
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
1938
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
1939
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
1940
+ *
1941
+ * The promise rejects with an Error if the call fails; the full log is in
1942
+ * {@link Socket.lastErrorText}.
1943
+ */
1944
+ receiveInt32Async(bigEndian: boolean): Promise<void>
1945
+
1946
+ /**
1947
+ * Receives exactly `numBytes` bytes and returns them encoded using
1948
+ * `encodingAlg`. Supported encoding names include
1949
+ * `base64`, `modBase64`, `base32`,
1950
+ * `uu`, `qp`, `url`, `hex`,
1951
+ * `q`, `b`, `url_oauth`,
1952
+ * `url_rfc1738`, `url_rfc2396`, and
1953
+ * `url_rfc3986`. See
1954
+ * [all supported
1955
+ * Chilkat binary encodings](https://cknotes.com/chilkat-binary-encoding-list/). Inactivity is
1956
+ * controlled by
1957
+ * `MaxReadIdleMs`.
1958
+ *
1959
+ * **Partial data is discarded on failure:**
1960
+ * If the exact byte count cannot be obtained, no partial encoded result is
1961
+ * returned and the output string is empty. Any partial bytes already read are
1962
+ * consumed from the connection and discarded; they are not retained internally
1963
+ * and cannot be recovered by a later receive call. This differs from
1964
+ * `ReceiveBytesN` and `ReceiveBdN`, which expose partial
1965
+ * data on failure.
1966
+ *
1967
+ * **Validate lengths:**
1968
+ * Validate any peer-supplied length before requesting a large amount of data. If
1969
+ * the peer sends too few bytes while keeping the connection open, the method
1970
+ * waits until the inactivity timeout.
1971
+ *
1972
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
1973
+ * {@link Socket.receiveNBytesENCAsync}.
1974
+ *
1975
+ * @throws Error if the call fails (the message names the reason); the full log is in
1976
+ * {@link Socket.lastErrorText}.
1977
+ */
1978
+ receiveNBytesENC(numBytes: number, encodingAlg: string): string
1979
+
1980
+ /**
1981
+ * Asynchronous form of {@link Socket.receiveNBytesENC}: the same call on a native worker thread,
1982
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
1983
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
1984
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
1985
+ *
1986
+ * The promise rejects with an Error if the call fails; the full log is in
1987
+ * {@link Socket.lastErrorText}.
1988
+ */
1989
+ receiveNBytesENCAsync(numBytes: number, encodingAlg: string): Promise<string>
1990
+
1991
+ /**
1992
+ * Receives text and decodes it using `StringCharset`. Chilkat first
1993
+ * uses any plaintext already buffered internally. Otherwise, it receives until
1994
+ * it can return the first nonempty decoded result. The method does not continue
1995
+ * reading merely to drain all data that may be available.
1996
+ *
1997
+ * -
1998
+ * For plain TCP, the underlying direct read obtains at most
1999
+ * `ReceivePacketSize` bytes.
2000
+ *
2001
+ * -
2002
+ * For TLS or SSH, the amount is governed by the TLS record or SSH packet and
2003
+ * is not limited by `ReceivePacketSize`.
2004
+ *
2005
+ * -
2006
+ * Already-buffered plaintext is returned in full, even if it exceeds
2007
+ * `ReceivePacketSize`.
2008
+ *
2009
+ * -
2010
+ * On success, the returned text represents at least one received byte; this
2011
+ * method does not produce a successful empty result.
2012
+ *
2013
+ * **Inspect the returned text even on failure:**
2014
+ * An orderly peer close reports `ReceiveFailReason = 10`, but the
2015
+ * returned string may contain final text received immediately before the close.
2016
+ * For APIs that return a string directly, check `LastMethodFailed`
2017
+ * without discarding the returned value.
2018
+ *
2019
+ * **Text framing:**
2020
+ * A receive can end in the middle of an application message or multibyte text
2021
+ * sequence. For framed text protocols, prefer an exact-length or
2022
+ * delimiter-based receive method.
2023
+ *
2024
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
2025
+ * {@link Socket.receiveStringAsync}.
2026
+ *
2027
+ * @throws Error if the call fails (the message names the reason); the full log is in
2028
+ * {@link Socket.lastErrorText}.
2029
+ */
2030
+ receiveString(): string
2031
+
2032
+ /**
2033
+ * Asynchronous form of {@link Socket.receiveString}: the same call on a native worker thread,
2034
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
2035
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
2036
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
2037
+ *
2038
+ * The promise rejects with an Error if the call fails; the full log is in
2039
+ * {@link Socket.lastErrorText}.
2040
+ */
2041
+ receiveStringAsync(): Promise<string>
2042
+
2043
+ /**
2044
+ * Receives and decodes text like `ReceiveString`, but returns at most `maxByteCount` input bytes.
2045
+ * The limit is measured in bytes, not Unicode characters.
2046
+ *
2047
+ * **Important:** A byte limit can split a multibyte character or a protocol message. Choose a
2048
+ * limit compatible with the encoding and framing used by the peer.
2049
+ *
2050
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
2051
+ * {@link Socket.receiveStringMaxNAsync}.
2052
+ *
2053
+ * @throws Error if the call fails (the message names the reason); the full log is in
2054
+ * {@link Socket.lastErrorText}.
2055
+ */
2056
+ receiveStringMaxN(maxByteCount: number): string
2057
+
2058
+ /**
2059
+ * Asynchronous form of {@link Socket.receiveStringMaxN}: the same call on a native worker thread,
2060
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
2061
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
2062
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
2063
+ *
2064
+ * The promise rejects with an Error if the call fails; the full log is in
2065
+ * {@link Socket.lastErrorText}.
2066
+ */
2067
+ receiveStringMaxNAsync(maxByteCount: number): Promise<string>
2068
+
2069
+ /**
2070
+ * Receives bytes until the raw byte value `lookForByte` is found.
2071
+ * The delimiter is excluded from the returned string. The bytes preceding the
2072
+ * delimiter are then decoded using `StringCharset`.
2073
+ *
2074
+ * The delimiter search is purely byte-oriented and does not recognize character
2075
+ * boundaries. A match may therefore occur inside the encoded representation of
2076
+ * a multibyte character.
2077
+ *
2078
+ * **Multibyte character boundary:**
2079
+ * With a multibyte encoding, a non-ASCII delimiter byte can occur inside an
2080
+ * encoded character. The receive can stop in the middle of that character, and
2081
+ * the incomplete character may be dropped, replaced, or decoded incorrectly.
2082
+ * Prefer an ASCII delimiter value below `0x80` with an
2083
+ * ASCII-compatible charset such as UTF-8, an ISO-8859 encoding, a Windows-125x
2084
+ * encoding, or Shift-JIS.
2085
+ *
2086
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
2087
+ * {@link Socket.receiveStringUntilByteAsync}.
2088
+ *
2089
+ * @throws Error if the call fails (the message names the reason); the full log is in
2090
+ * {@link Socket.lastErrorText}.
2091
+ */
2092
+ receiveStringUntilByte(lookForByte: number): string
2093
+
2094
+ /**
2095
+ * Asynchronous form of {@link Socket.receiveStringUntilByte}: the same call on a native worker
2096
+ * thread,
2097
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
2098
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
2099
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
2100
+ *
2101
+ * The promise rejects with an Error if the call fails; the full log is in
2102
+ * {@link Socket.lastErrorText}.
2103
+ */
2104
+ receiveStringUntilByteAsync(lookForByte: number): Promise<string>
2105
+
2106
+ /**
2107
+ * Receives text through a CRLF line terminator and returns the text including
2108
+ * the terminator. Chilkat encodes the CR followed by LF characters using
2109
+ * `StringCharset`, then searches the incoming byte stream for that
2110
+ * exact encoded sequence. The accumulated bytes are decoded using the same
2111
+ * charset after the delimiter is found.
2112
+ *
2113
+ * **Charset-dependent delimiter:**
2114
+ * For ASCII-compatible charsets such as UTF-8, US-ASCII, ISO-8859 encodings,
2115
+ * Windows-125x encodings, and Shift-JIS, the delimiter bytes are the usual
2116
+ * `0D 0A`. With a wide charset such as UTF-16LE, the encoded
2117
+ * delimiter is different, for example `0D 00 0A 00`.
2118
+ *
2119
+ * **Tip:**
2120
+ * This method is useful for line-oriented text protocols. Do not use it for
2121
+ * protocols that permit bare LF, binary data, or a different line terminator.
2122
+ *
2123
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
2124
+ * {@link Socket.receiveToCRLFAsync}.
2125
+ *
2126
+ * @throws Error if the call fails (the message names the reason); the full log is in
2127
+ * {@link Socket.lastErrorText}.
2128
+ */
2129
+ receiveToCRLF(): string
2130
+
2131
+ /**
2132
+ * Asynchronous form of {@link Socket.receiveToCRLF}: the same call on a native worker thread,
2133
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
2134
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
2135
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
2136
+ *
2137
+ * The promise rejects with an Error if the call fails; the full log is in
2138
+ * {@link Socket.lastErrorText}.
2139
+ */
2140
+ receiveToCRLFAsync(): Promise<string>
2141
+
2142
+ /**
2143
+ * Receives bytes until the exact byte sequence represented by
2144
+ * `matchStr` is found. Chilkat first encodes
2145
+ * `matchStr` using `StringCharset`, then performs a
2146
+ * case-sensitive, byte-for-byte comparison against the incoming stream. No
2147
+ * case folding, Unicode normalization, or text-level comparison is performed.
2148
+ *
2149
+ * The match may span multiple underlying network reads. After the delimiter is
2150
+ * found, the complete accumulated byte sequence is decoded using
2151
+ * `StringCharset` and returned as text. The returned text includes
2152
+ * the matching delimiter.
2153
+ *
2154
+ * **Empty match strings:**
2155
+ * If `matchStr` is empty, or if it encodes to zero bytes under the
2156
+ * current `StringCharset`, the method fails immediately with
2157
+ * `ReceiveFailReason = 4`. No data is read from the connection and
2158
+ * the returned string is empty.
2159
+ *
2160
+ * **Partial content is discarded on failure:**
2161
+ * If the delimiter is not found before a timeout, application abort, peer
2162
+ * close, connection reset, or other failure, the returned string is empty.
2163
+ * Bytes already consumed while searching are discarded, are not retained for a
2164
+ * later receive, and cannot be recovered. If an orderly peer close is detected,
2165
+ * `ReceiveFailReason` is `10`.
2166
+ *
2167
+ * On success, bytes read beyond the delimiter may remain buffered internally
2168
+ * for the next receive call. This is why `ReceivedCount` can increase
2169
+ * by more than the number of bytes represented by the returned string.
2170
+ *
2171
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
2172
+ * {@link Socket.receiveUntilMatchAsync}.
2173
+ *
2174
+ * @throws Error if the call fails (the message names the reason); the full log is in
2175
+ * {@link Socket.lastErrorText}.
2176
+ */
2177
+ receiveUntilMatch(matchStr: string): string
2178
+
2179
+ /**
2180
+ * Asynchronous form of {@link Socket.receiveUntilMatch}: the same call on a native worker thread,
2181
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
2182
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
2183
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
2184
+ *
2185
+ * The promise rejects with an Error if the call fails; the full log is in
2186
+ * {@link Socket.lastErrorText}.
2187
+ */
2188
+ receiveUntilMatchAsync(matchStr: string): Promise<string>
2189
+
2190
+ /**
2191
+ * Waits for read-ready activity on this socket or, when this object is a socket set, on any
2192
+ * contained socket.
2193
+ *
2194
+ * - `timeoutMs = 0` performs a nonblocking poll and returns immediately.
2195
+ *
2196
+ * - A positive value waits up to that many milliseconds.
2197
+ *
2198
+ * - A negative value currently produces an effectively very long wait. Applications should
2199
+ * normally use `0` or a positive value rather than depend on this behavior.
2200
+ *
2201
+ * Return valueMeaning
2202
+ *
2203
+ * | Positive | | The number of sockets in the read-ready result. |
2204
+ *
2205
+ * | 0 | | No socket was ready at the time of the poll or before the timeout. |
2206
+ *
2207
+ * | -1 | | An error occurred. |
2208
+ *
2209
+ * A connected socket is read-ready when data is available or when a close/error condition can be
2210
+ * detected. A listener is read-ready when an incoming connection is pending. Listener and
2211
+ * connected sockets may coexist in one set, but the set does not identify which type a ready
2212
+ * member is; the application must track that information and call `AcceptNext` or a receive
2213
+ * method as appropriate.
2214
+ *
2215
+ * **Correct socket-set loop:**
2216
+ * If this method returns `n`, iterate from `0` through `n - 1`, assign each value directly to
2217
+ * `SelectorReadIndex`, and then operate on this socket-set object. Do not assign the value to
2218
+ * `SelectorIndex`.
2219
+ *
2220
+ * **Ready-set lifetime:**
2221
+ * The ready-set is fixed for this result, so it can be iterated safely. Its order is arbitrary,
2222
+ * is not guaranteed to match insertion order, and can differ on the next select call. Calling
2223
+ * either select method again invalidates all prior read/write indices.
2224
+ *
2225
+ * **Automatic pruning:**
2226
+ * Each select rebuilds the underlying descriptor set and removes contained sockets that can no
2227
+ * longer contribute a valid descriptor. A dead socket can therefore remain counted only until the
2228
+ * next select.
2229
+ *
2230
+ * **Readiness is not data:**
2231
+ * A receive may report that the peer closed or reset the connection instead of returning
2232
+ * application data. Within one ready-set iteration, closing a selected socket does not renumber
2233
+ * the other ready positions, but the closed socket's own position no longer resolves.
2234
+ *
2235
+ * **Socket sets overview:** See [Socket Sets
2236
+ * Overview](https://www.chilkatsoft.com/socket_sets.asp) for an explanation of socket sets,
2237
+ * selectors, readiness, ownership, and common usage patterns.
2238
+ *
2239
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
2240
+ * {@link Socket.selectForReadingAsync}.
2241
+ */
2242
+ selectForReading(timeoutMs: number): number
2243
+
2244
+ /**
2245
+ * Asynchronous form of {@link Socket.selectForReading}: the same call on a native worker thread,
2246
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
2247
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
2248
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
2249
+ */
2250
+ selectForReadingAsync(timeoutMs: number): Promise<number>
2251
+
2252
+ /**
2253
+ * Waits for this socket, or sockets in a socket set, to become writable without blocking.
2254
+ *
2255
+ * - `timeoutMs = 0` performs a nonblocking poll and returns immediately.
2256
+ *
2257
+ * - A positive value waits up to that many milliseconds.
2258
+ *
2259
+ * - A negative value currently produces an effectively very long wait. Applications should
2260
+ * normally use `0` or a positive value rather than depend on this behavior.
2261
+ *
2262
+ * Return valueMeaning
2263
+ *
2264
+ * | Positive | | The number of sockets in the write-ready result. |
2265
+ *
2266
+ * | 0 | | No socket was writable at the time of the poll or before the timeout. |
2267
+ *
2268
+ * | -1 | | An error occurred. |
2269
+ *
2270
+ * **Correct socket-set loop:** If this method returns `n`, iterate from `0` through `n - 1`,
2271
+ * assign each value directly to `SelectorWriteIndex`, and then operate on this socket-set object.
2272
+ * Do not assign the value to `SelectorIndex`.
2273
+ *
2274
+ * **Ready-set lifetime:** The result remains stable for the current iteration, but its order is
2275
+ * arbitrary and need not match insertion order. Calling either select method again invalidates
2276
+ * all prior read/write indices. Each select also prunes contained sockets that no longer have a
2277
+ * usable descriptor.
2278
+ *
2279
+ * **Write readiness:** TCP writes normally complete into the operating-system send buffer.
2280
+ * Readiness does not mean the remote application has received or processed the data.
2281
+ *
2282
+ * **Socket sets overview:** See [Socket Sets
2283
+ * Overview](https://www.chilkatsoft.com/socket_sets.asp) for an explanation of socket sets,
2284
+ * selectors, readiness, ownership, and common usage patterns.
2285
+ *
2286
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
2287
+ * {@link Socket.selectForWritingAsync}.
2288
+ */
2289
+ selectForWriting(timeoutMs: number): number
2290
+
2291
+ /**
2292
+ * Asynchronous form of {@link Socket.selectForWriting}: the same call on a native worker thread,
2293
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
2294
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
2295
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
2296
+ */
2297
+ selectForWritingAsync(timeoutMs: number): Promise<number>
2298
+
2299
+ /**
2300
+ * Sends one byte whose value is specified by `value`. The value must be in the range `0` through
2301
+ * `255`. The method returns after the byte has been accepted for transmission or a send failure
2302
+ * occurs.
2303
+ *
2304
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
2305
+ * {@link Socket.sendByteAsync}.
2306
+ *
2307
+ * @throws Error if the call fails (the message names the reason); the full log is in
2308
+ * {@link Socket.lastErrorText}.
2309
+ */
2310
+ sendByte(value: number): void
2311
+
2312
+ /**
2313
+ * Asynchronous form of {@link Socket.sendByte}: the same call on a native worker thread,
2314
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
2315
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
2316
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
2317
+ *
2318
+ * The promise rejects with an Error if the call fails; the full log is in
2319
+ * {@link Socket.lastErrorText}.
2320
+ */
2321
+ sendByteAsync(value: number): Promise<void>
2322
+
2323
+ /**
2324
+ * Decodes `encodedBytes` using `encodingAlg`, then sends the resulting binary bytes. Supported
2325
+ * Chilkat encoding names include `base64`, `modBase64`, `base32`, `base58`, `uu`, `qp`, `url`,
2326
+ * `hex`, `q`, `b`, `url_oauth`, `url_rfc1738`, `url_rfc2396`, and `url_rfc3986`. See [all
2327
+ * supported Chilkat binary encodings](https://cknotes.com/chilkat-binary-encoding-list/).
2328
+ *
2329
+ * For example, `encodedBytes="00010203040506"` with `encodingAlg="hex"` sends seven bytes with
2330
+ * values 00 through 06.
2331
+ *
2332
+ * **Important:** Malformed encoded input causes the method to fail before or during sending.
2333
+ * Check `SendFailReason` and `LastErrorText`.
2334
+ *
2335
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
2336
+ * {@link Socket.sendBytesENCAsync}.
2337
+ *
2338
+ * @throws Error if the call fails (the message names the reason); the full log is in
2339
+ * {@link Socket.lastErrorText}.
2340
+ */
2341
+ sendBytesENC(encodedBytes: string, encodingAlg: string): void
2342
+
2343
+ /**
2344
+ * Asynchronous form of {@link Socket.sendBytesENC}: the same call on a native worker thread,
2345
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
2346
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
2347
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
2348
+ *
2349
+ * The promise rejects with an Error if the call fails; the full log is in
2350
+ * {@link Socket.lastErrorText}.
2351
+ */
2352
+ sendBytesENCAsync(encodedBytes: string, encodingAlg: string): Promise<void>
2353
+
2354
+ /**
2355
+ * Sends `byteCount` as its four-byte signed two's-complement bit pattern. Byte order is
2356
+ * controlled by `BigEndian`, whose default is `true` for network byte order. Any signed 32-bit
2357
+ * value is serialized without validation.
2358
+ *
2359
+ * The peer can read the value using `ReceiveCount`, except that `-1` is not usable as an ordinary
2360
+ * count because `ReceiveCount` reserves `-1` as its failure result.
2361
+ *
2362
+ * **Tip:** A length prefix is a common way to frame messages over TCP: send the count first, then
2363
+ * exactly that many payload bytes. Validate received lengths before allocating memory or waiting
2364
+ * for data.
2365
+ *
2366
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
2367
+ * {@link Socket.sendCountAsync}.
2368
+ *
2369
+ * @throws Error if the call fails (the message names the reason); the full log is in
2370
+ * {@link Socket.lastErrorText}.
2371
+ */
2372
+ sendCount(byteCount: number): void
2373
+
2374
+ /**
2375
+ * Asynchronous form of {@link Socket.sendCount}: the same call on a native worker thread,
2376
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
2377
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
2378
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
2379
+ *
2380
+ * The promise rejects with an Error if the call fails; the full log is in
2381
+ * {@link Socket.lastErrorText}.
2382
+ */
2383
+ sendCountAsync(byteCount: number): Promise<void>
2384
+
2385
+ /**
2386
+ * Sends the low 16 bits of `value` as a two-byte two's-complement bit pattern. Set `bigEndian` to
2387
+ * `true` for network byte order or `false` for little-endian order.
2388
+ *
2389
+ * No range validation is performed. Signed values from `-32768` through `32767` and unsigned
2390
+ * values from `0` through `65535` can be represented directly. Any other integer is silently
2391
+ * truncated to its low 16 bits, equivalent to taking the value modulo 65536.
2392
+ *
2393
+ * **Examples:** `40000` writes `0x9C40`, `-1` writes `0xFFFF`, `65536` writes `0x0000`, and
2394
+ * `70000` writes `0x1170`.
2395
+ *
2396
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
2397
+ * {@link Socket.sendInt16Async}.
2398
+ *
2399
+ * @throws Error if the call fails (the message names the reason); the full log is in
2400
+ * {@link Socket.lastErrorText}.
2401
+ */
2402
+ sendInt16(value: number, bigEndian: boolean): void
2403
+
2404
+ /**
2405
+ * Asynchronous form of {@link Socket.sendInt16}: the same call on a native worker thread,
2406
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
2407
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
2408
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
2409
+ *
2410
+ * The promise rejects with an Error if the call fails; the full log is in
2411
+ * {@link Socket.lastErrorText}.
2412
+ */
2413
+ sendInt16Async(value: number, bigEndian: boolean): Promise<void>
2414
+
2415
+ /**
2416
+ * Sends `value` as its complete four-byte signed two's-complement bit pattern. Set `bigEndian` to
2417
+ * `true` for network byte order or `false` for little-endian order.
2418
+ *
2419
+ * The parameter is a signed 32-bit integer and there is no unsigned overload, but every 32-bit
2420
+ * wire pattern can be represented by passing the signed integer having that bit pattern. For
2421
+ * example, passing `-1` writes `0xFFFFFFFF`. Because the input is already 32 bits, no bits are
2422
+ * truncated.
2423
+ *
2424
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
2425
+ * {@link Socket.sendInt32Async}.
2426
+ *
2427
+ * @throws Error if the call fails (the message names the reason); the full log is in
2428
+ * {@link Socket.lastErrorText}.
2429
+ */
2430
+ sendInt32(value: number, bigEndian: boolean): void
2431
+
2432
+ /**
2433
+ * Asynchronous form of {@link Socket.sendInt32}: the same call on a native worker thread,
2434
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
2435
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
2436
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
2437
+ *
2438
+ * The promise rejects with an Error if the call fails; the full log is in
2439
+ * {@link Socket.lastErrorText}.
2440
+ */
2441
+ sendInt32Async(value: number, bigEndian: boolean): Promise<void>
2442
+
2443
+ /**
2444
+ * Encodes `stringToSend` using `StringCharset` and sends the
2445
+ * resulting bytes over the connected TCP or TLS socket. The method is
2446
+ * synchronous and uses `MaxSendIdleMs` as the maximum period during
2447
+ * which no send progress may occur. No delimiter, terminator, or length prefix
2448
+ * is added automatically.
2449
+ *
2450
+ * **Partial transmission on failure:**
2451
+ * A failed call may already have sent part of the encoded byte sequence. Chilkat
2452
+ * does not retain or queue the unsent remainder and does not report how many
2453
+ * bytes were sent. A timeout or application abort may leave the TCP connection
2454
+ * open,
2455
+ * but the application-protocol stream may contain a truncated message. For a
2456
+ * framed protocol, normally close the connection and reconnect before sending
2457
+ * another message. A peer close or reset leaves the connection unusable for
2458
+ * further I/O.
2459
+ *
2460
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
2461
+ * {@link Socket.sendStringAsync}.
2462
+ *
2463
+ * @throws Error if the call fails (the message names the reason); the full log is in
2464
+ * {@link Socket.lastErrorText}.
2465
+ */
2466
+ sendString(stringToSend: string): void
2467
+
2468
+ /**
2469
+ * Asynchronous form of {@link Socket.sendString}: the same call on a native worker thread,
2470
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
2471
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
2472
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
2473
+ *
2474
+ * The promise rejects with an Error if the call fails; the full log is in
2475
+ * {@link Socket.lastErrorText}.
2476
+ */
2477
+ sendStringAsync(stringToSend: string): Promise<void>
2478
+
2479
+ /**
2480
+ * Configures `cert` as the client certificate for subsequent TLS connections. The certificate
2481
+ * must have access to its private key. Use this only when the server requests or requires
2482
+ * client-certificate authentication.
2483
+ *
2484
+ * **Important:** Configure the client certificate before `Connect` or `ConvertToSsl`. A
2485
+ * certificate without its private key cannot prove client identity.
2486
+ *
2487
+ * @throws Error if the call fails (the message names the reason); the full log is in
2488
+ * {@link Socket.lastErrorText}.
2489
+ */
2490
+ setSslClientCert(cert: Cert): void
2491
+
2492
+ /**
2493
+ * Loads and configures a TLS client certificate and private key from PEM data or a PEM filename
2494
+ * supplied in `pemDataOrFilename`. Use `pemPassword` when the private key is encrypted.
2495
+ *
2496
+ * **Important:** The PEM material must include or make available the private key corresponding to
2497
+ * the certificate. Configure it before the TLS handshake begins.
2498
+ *
2499
+ * @throws Error if the call fails (the message names the reason); the full log is in
2500
+ * {@link Socket.lastErrorText}.
2501
+ */
2502
+ setSslClientCertPem(pemDataOrFilename: string, pemPassword: string): void
2503
+
2504
+ /**
2505
+ * Loads and configures a TLS client certificate and private key from the PFX/P12 file
2506
+ * `pfxFilename`, using `pfxPassword`. Use this only when the server requests or requires
2507
+ * client-certificate authentication.
2508
+ *
2509
+ * **Important:** Protect PFX files and passwords because they contain private-key material.
2510
+ *
2511
+ * @throws Error if the call fails (the message names the reason); the full log is in
2512
+ * {@link Socket.lastErrorText}.
2513
+ */
2514
+ setSslClientCertPfx(pfxFilename: string, pfxPassword: string): void
2515
+
2516
+ /**
2517
+ * Pauses the calling thread for approximately `millisec` milliseconds. This is a convenience
2518
+ * method and does not perform network I/O or keep a connection alive.
2519
+ *
2520
+ * **Important:** Sleeping blocks the current thread. It is not a substitute for socket readiness
2521
+ * methods, asynchronous I/O, or protocol timers.
2522
+ */
2523
+ sleepMs(millisec: number): void
2524
+
2525
+ /**
2526
+ * Authenticates the SSH tunnel session as `sshLogin` using `privateKey`. Call `SshOpenTunnel`
2527
+ * first. The SSH server must have the corresponding public key authorized for that account.
2528
+ *
2529
+ * **Important:** This authenticates the SSH transport used by the socket tunnel. It does not
2530
+ * authenticate the final destination protocol reached through a forwarded channel.
2531
+ *
2532
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
2533
+ * {@link Socket.sshAuthenticatePkAsync}.
2534
+ *
2535
+ * @throws Error if the call fails (the message names the reason); the full log is in
2536
+ * {@link Socket.lastErrorText}.
2537
+ */
2538
+ sshAuthenticatePk(sshLogin: string, privateKey: SshKey): void
2539
+
2540
+ /**
2541
+ * Asynchronous form of {@link Socket.sshAuthenticatePk}: the same call on a native worker thread,
2542
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
2543
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
2544
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
2545
+ *
2546
+ * The promise rejects with an Error if the call fails; the full log is in
2547
+ * {@link Socket.lastErrorText}.
2548
+ */
2549
+ sshAuthenticatePkAsync(sshLogin: string, privateKey: SshKey): Promise<void>
2550
+
2551
+ /**
2552
+ * Authenticates the SSH tunnel session using `sshLogin` and `sshPassword`. Call `SshOpenTunnel`
2553
+ * first and authenticate before opening forwarded channels.
2554
+ *
2555
+ * **Important:** Do not log or expose the SSH password. Public-key authentication is generally
2556
+ * preferable when supported.
2557
+ *
2558
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
2559
+ * {@link Socket.sshAuthenticatePwAsync}.
2560
+ *
2561
+ * @throws Error if the call fails (the message names the reason); the full log is in
2562
+ * {@link Socket.lastErrorText}.
2563
+ */
2564
+ sshAuthenticatePw(sshLogin: string, sshPassword: string): void
2565
+
2566
+ /**
2567
+ * Asynchronous form of {@link Socket.sshAuthenticatePw}: the same call on a native worker thread,
2568
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
2569
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
2570
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
2571
+ *
2572
+ * The promise rejects with an Error if the call fails; the full log is in
2573
+ * {@link Socket.lastErrorText}.
2574
+ */
2575
+ sshAuthenticatePwAsync(sshLogin: string, sshPassword: string): Promise<void>
2576
+
2577
+ /**
2578
+ * Closes the SSH tunnel opened by `SshOpenTunnel` and terminates its forwarded channels. It does
2579
+ * not close unrelated SSH objects or connections.
2580
+ *
2581
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
2582
+ * {@link Socket.sshCloseTunnelAsync}.
2583
+ *
2584
+ * @throws Error if the call fails (the message names the reason); the full log is in
2585
+ * {@link Socket.lastErrorText}.
2586
+ */
2587
+ sshCloseTunnel(): void
2588
+
2589
+ /**
2590
+ * Asynchronous form of {@link Socket.sshCloseTunnel}: the same call on a native worker thread,
2591
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
2592
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
2593
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
2594
+ *
2595
+ * The promise rejects with an Error if the call fails; the full log is in
2596
+ * {@link Socket.lastErrorText}.
2597
+ */
2598
+ sshCloseTunnelAsync(): Promise<void>
2599
+
2600
+ /**
2601
+ * Connects to the SSH server at `sshHostname`:`sshPort` and
2602
+ * initializes an SSH tunneling session. Port `22` is conventional but
2603
+ * not required.
2604
+ *
2605
+ * After this succeeds, authenticate with `SshAuthenticatePw` or
2606
+ * `SshAuthenticatePk`, then open forwarded destination channels with
2607
+ * `SshNewChannel`. Multiple channels can share the same authenticated
2608
+ * tunnel.
2609
+ *
2610
+ * **Timeouts:**
2611
+ * This method has no dedicated wait argument. SSH protocol read and write
2612
+ * inactivity are governed by `MaxReadIdleMs` and
2613
+ * `MaxSendIdleMs`. The default value of `0` for those
2614
+ * properties permits an indefinite wait while no progress is made.
2615
+ *
2616
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
2617
+ * {@link Socket.sshOpenTunnelAsync}.
2618
+ *
2619
+ * @throws Error if the call fails (the message names the reason); the full log is in
2620
+ * {@link Socket.lastErrorText}.
2621
+ */
2622
+ sshOpenTunnel(sshHostname: string, sshPort: number): void
2623
+
2624
+ /**
2625
+ * Asynchronous form of {@link Socket.sshOpenTunnel}: the same call on a native worker thread,
2626
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
2627
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
2628
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
2629
+ *
2630
+ * The promise rejects with an Error if the call fails; the full log is in
2631
+ * {@link Socket.lastErrorText}.
2632
+ */
2633
+ sshOpenTunnelAsync(sshHostname: string, sshPort: number): Promise<void>
2634
+
2635
+ /**
2636
+ * Starts or restarts the object's convenience timer. Read `ElapsedSeconds` to obtain the whole
2637
+ * number of seconds since this call.
2638
+ *
2639
+ * **Note:** This timer does not affect connection, send, or receive timeouts.
2640
+ */
2641
+ startTiming(): void
2642
+
2643
+ /**
2644
+ * Moves the connection out of `sock` and into a newly created member of this object's socket set.
2645
+ * After one or more successful calls, this object acts as a set of connected and/or listener
2646
+ * sockets.
2647
+ *
2648
+ * After success, `sock` holds no connection. It may be closed, destroyed, or reused immediately
2649
+ * without affecting the transferred connection. The new set member owns the connection
2650
+ * independently; there is no shared ownership to coordinate.
2651
+ *
2652
+ * **Set workflow:** Use `SelectorIndex` to select a direct member. After `SelectForReading` or
2653
+ * `SelectForWriting`, assign the ready position directly to `SelectorReadIndex` or
2654
+ * `SelectorWriteIndex`.
2655
+ *
2656
+ * **Different from TakeConnection:** `TakeSocket` adds a new member to the socket set.
2657
+ * `TakeConnection` moves a connection into the receiving object itself and is not a set-building
2658
+ * method.
2659
+ *
2660
+ * **Socket sets overview:** See [Socket Sets
2661
+ * Overview](https://www.chilkatsoft.com/socket_sets.asp) for an explanation of socket sets,
2662
+ * selectors, readiness, ownership, and common usage patterns.
2663
+ *
2664
+ * @throws Error if the call fails (the message names the reason); the full log is in
2665
+ * {@link Socket.lastErrorText}.
2666
+ */
2667
+ takeSocket(sock: Socket): void
2668
+
2669
+ /**
2670
+ * Requests TLS renegotiation on an established TLS connection, causing another handshake to
2671
+ * negotiate new security parameters where the protocol and peer support it.
2672
+ *
2673
+ * **Important:** TLS 1.3 does not use legacy renegotiation, and many modern TLS 1.2 servers
2674
+ * disable it. The method can therefore fail even on an otherwise healthy TLS connection.
2675
+ *
2676
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
2677
+ * {@link Socket.tlsRenegotiateAsync}.
2678
+ *
2679
+ * @throws Error if the call fails (the message names the reason); the full log is in
2680
+ * {@link Socket.lastErrorText}.
2681
+ */
2682
+ tlsRenegotiate(): void
2683
+
2684
+ /**
2685
+ * Asynchronous form of {@link Socket.tlsRenegotiate}: the same call on a native worker thread,
2686
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
2687
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
2688
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
2689
+ *
2690
+ * The promise rejects with an Error if the call fails; the full log is in
2691
+ * {@link Socket.lastErrorText}.
2692
+ */
2693
+ tlsRenegotiateAsync(): Promise<void>
2694
+
2695
+ /**
2696
+ * Configures this socket to route subsequent `Connect` calls through the already connected and
2697
+ * authenticated `Ssh` object. The destination host and port passed to `Connect` are reached by
2698
+ * SSH port forwarding rather than by a direct TCP connection.
2699
+ *
2700
+ * This is one of several SSH-tunneling models in Chilkat. Alternatives include this class's
2701
+ * `SshOpenTunnel`/`SshNewChannel` workflow and the separate `SshTunnel` class for background
2702
+ * static or dynamic forwarding.
2703
+ *
2704
+ * **Important:** The supplied `Ssh` object must remain connected and authenticated while the
2705
+ * forwarded socket connection is being established and used.
2706
+ *
2707
+ * @throws Error if the call fails (the message names the reason); the full log is in
2708
+ * {@link Socket.lastErrorText}.
2709
+ */
2710
+ useSsh(ssh: Ssh): void
2711
+
2712
+ /**
2713
+ * Receives one delivery of binary data and appends it to `binData`.
2714
+ * Chilkat first appends any data already buffered internally. If no buffered
2715
+ * data exists, the method performs one receive operation; it does not loop to
2716
+ * drain everything that may be available.
2717
+ *
2718
+ * -
2719
+ * For plain TCP, a direct read obtains at most
2720
+ * `ReceivePacketSize` bytes.
2721
+ *
2722
+ * -
2723
+ * For TLS or SSH, the amount is governed by the TLS record or SSH packet and
2724
+ * is not limited by `ReceivePacketSize`.
2725
+ *
2726
+ * -
2727
+ * Already-buffered data is appended in full, even if it exceeds
2728
+ * `ReceivePacketSize`.
2729
+ *
2730
+ * -
2731
+ * A successful call can append zero bytes during TLS renegotiation. Treat this
2732
+ * as no application data yet and call the receive method again.
2733
+ *
2734
+ * **Inspect the destination even on failure:**
2735
+ * An orderly peer close reports `ReceiveFailReason = 10`, but
2736
+ * `binData` may contain final bytes received immediately before the
2737
+ * close.
2738
+ *
2739
+ * **TCP framing:**
2740
+ * TCP does not preserve message boundaries. Define framing in the application
2741
+ * protocol, such as an exact length, delimiter, fixed-size record, or
2742
+ * connection close.
2743
+ *
2744
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
2745
+ * {@link Socket.receiveBdAsync}.
2746
+ *
2747
+ * @throws Error if the call fails (the message names the reason); the full log is in
2748
+ * {@link Socket.lastErrorText}.
2749
+ */
2750
+ receiveBd(binData: BinData): void
2751
+
2752
+ /**
2753
+ * Asynchronous form of {@link Socket.receiveBd}: the same call on a native worker thread,
2754
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
2755
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
2756
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
2757
+ *
2758
+ * The promise rejects with an Error if the call fails; the full log is in
2759
+ * {@link Socket.lastErrorText}.
2760
+ */
2761
+ receiveBdAsync(binData: BinData): Promise<void>
2762
+
2763
+ /**
2764
+ * Receives text, decodes it using `StringCharset`, and appends it to
2765
+ * `sb`. Chilkat first uses any plaintext already buffered internally.
2766
+ * Otherwise, it receives until it can append the first nonempty decoded result.
2767
+ * The method does not continue reading merely to drain all data that may be
2768
+ * available.
2769
+ *
2770
+ * -
2771
+ * For plain TCP, the underlying direct read obtains at most
2772
+ * `ReceivePacketSize` bytes.
2773
+ *
2774
+ * -
2775
+ * For TLS or SSH, the amount is governed by the TLS record or SSH packet and
2776
+ * is not limited by `ReceivePacketSize`.
2777
+ *
2778
+ * -
2779
+ * Already-buffered plaintext is appended in full, even if it exceeds
2780
+ * `ReceivePacketSize`.
2781
+ *
2782
+ * -
2783
+ * On success, at least one received byte contributes to the appended text;
2784
+ * this method does not return success with an empty receive result.
2785
+ *
2786
+ * **Inspect the destination even on failure:**
2787
+ * An orderly peer close reports `ReceiveFailReason = 10`, but
2788
+ * `sb` may contain final text received immediately before the close.
2789
+ *
2790
+ * **TCP framing:**
2791
+ * TCP does not preserve message boundaries. Use a protocol-defined length or
2792
+ * delimiter when a complete text message is required.
2793
+ *
2794
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
2795
+ * {@link Socket.receiveSbAsync}.
2796
+ *
2797
+ * @throws Error if the call fails (the message names the reason); the full log is in
2798
+ * {@link Socket.lastErrorText}.
2799
+ */
2800
+ receiveSb(sb: StringBuilder): void
2801
+
2802
+ /**
2803
+ * Asynchronous form of {@link Socket.receiveSb}: the same call on a native worker thread,
2804
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
2805
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
2806
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
2807
+ *
2808
+ * The promise rejects with an Error if the call fails; the full log is in
2809
+ * {@link Socket.lastErrorText}.
2810
+ */
2811
+ receiveSbAsync(sb: StringBuilder): Promise<void>
2812
+
2813
+ /**
2814
+ * Sends bytes from `binData`, beginning at `offset`. If
2815
+ * `numBytes` is greater than `0`, that many bytes are
2816
+ * selected; if it is `0`, bytes are selected from `offset`
2817
+ * through the end. When both values are `0`, the entire
2818
+ * `BinData` is selected. The selected range must be valid.
2819
+ *
2820
+ * The method is synchronous and uses `MaxSendIdleMs` as the maximum
2821
+ * period during which no send progress may occur. No application message framing
2822
+ * is added.
2823
+ *
2824
+ * **Partial transmission on failure:**
2825
+ * A failed call may already have sent part of the selected range. Chilkat does
2826
+ * not retain or queue the unsent remainder and does not report the number of
2827
+ * bytes sent. A timeout or application abort may leave the TCP connection open,
2828
+ * but the protocol stream may contain a truncated message. For a framed
2829
+ * protocol, normally close the connection and reconnect rather than sending the
2830
+ * next message on the same stream. A peer close or reset leaves the connection
2831
+ * unusable for further I/O.
2832
+ *
2833
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
2834
+ * {@link Socket.sendBdAsync}.
2835
+ *
2836
+ * @throws Error if the call fails (the message names the reason); the full log is in
2837
+ * {@link Socket.lastErrorText}.
2838
+ */
2839
+ sendBd(binData: BinData, offset: number, numBytes: number): void
2840
+
2841
+ /**
2842
+ * Asynchronous form of {@link Socket.sendBd}: the same call on a native worker thread,
2843
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
2844
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
2845
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
2846
+ *
2847
+ * The promise rejects with an Error if the call fails; the full log is in
2848
+ * {@link Socket.lastErrorText}.
2849
+ */
2850
+ sendBdAsync(binData: BinData, offset: number, numBytes: number): Promise<void>
2851
+
2852
+ /**
2853
+ * Encodes the contents of `sb` using `StringCharset` and sends the resulting bytes. The method is
2854
+ * synchronous and uses `MaxSendIdleMs` as the send-progress inactivity limit.
2855
+ *
2856
+ * **Important:** No terminator or length prefix is added. Include any protocol framing in the
2857
+ * `StringBuilder` content.
2858
+ *
2859
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
2860
+ * {@link Socket.sendSbAsync}.
2861
+ *
2862
+ * @throws Error if the call fails (the message names the reason); the full log is in
2863
+ * {@link Socket.lastErrorText}.
2864
+ */
2865
+ sendSb(sb: StringBuilder): void
2866
+
2867
+ /**
2868
+ * Asynchronous form of {@link Socket.sendSb}: the same call on a native worker thread,
2869
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
2870
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
2871
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
2872
+ *
2873
+ * The promise rejects with an Error if the call fails; the full log is in
2874
+ * {@link Socket.lastErrorText}.
2875
+ */
2876
+ sendSbAsync(sb: StringBuilder): Promise<void>
2877
+
2878
+ /**
2879
+ * Receives exactly `numBytes` bytes and appends them to
2880
+ * `binData`. The method continues receiving until the requested count
2881
+ * is satisfied or a receive failure occurs. Inactivity is controlled by
2882
+ * `MaxReadIdleMs`.
2883
+ *
2884
+ * **The destination changes on failure:**
2885
+ * If a timeout, application abort, connection close, or reset occurs after only
2886
+ * part of the requested data is received, the method returns `false`,
2887
+ * but the partial bytes remain appended to `binData`. Those bytes have
2888
+ * been consumed from the connection, are included in `ReceivedCount`,
2889
+ * and are not retained internally for a later receive call.
2890
+ *
2891
+ * A timeout or application abort generally leaves the connection open. A peer
2892
+ * close or reset leaves it unavailable for further I/O. When the requested count
2893
+ * is successfully completed, bytes read beyond that count may remain buffered
2894
+ * internally for the next receive operation.
2895
+ *
2896
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
2897
+ * {@link Socket.receiveBdNAsync}.
2898
+ *
2899
+ * @throws Error if the call fails (the message names the reason); the full log is in
2900
+ * {@link Socket.lastErrorText}.
2901
+ */
2902
+ receiveBdN(numBytes: number, binData: BinData): void
2903
+
2904
+ /**
2905
+ * Asynchronous form of {@link Socket.receiveBdN}: the same call on a native worker thread,
2906
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
2907
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
2908
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
2909
+ *
2910
+ * The promise rejects with an Error if the call fails; the full log is in
2911
+ * {@link Socket.lastErrorText}.
2912
+ */
2913
+ receiveBdNAsync(numBytes: number, binData: BinData): Promise<void>
2914
+
2915
+ /**
2916
+ * Sends a Wake-on-LAN magic packet for `macAddress` to the UDP broadcast address
2917
+ * `ipBroadcastAddr` and `port`. The MAC address is six bytes written as hexadecimal, for example
2918
+ * `000102030405`. Ports `7` and `9` are commonly used.
2919
+ *
2920
+ * Call this method without first calling `Connect`. The target computer must have Wake-on-LAN
2921
+ * enabled in firmware, the network adapter, and the operating system, and the network must permit
2922
+ * the broadcast packet.
2923
+ *
2924
+ * **Important:** Wake-on-LAN generally works within a local network segment. Routers commonly
2925
+ * block directed broadcasts, and a successful send does not confirm that the target powered on.
2926
+ *
2927
+ * @throws Error if the call fails (the message names the reason); the full log is in
2928
+ * {@link Socket.lastErrorText}.
2929
+ */
2930
+ sendWakeOnLan(macAddress: string, port: number, ipBroadcastAddr: string): void
2931
+
2932
+ /**
2933
+ * Searches the inclusive range `beginPort` through `endPort` for an available TCP port, binds it,
2934
+ * and begins listening. The method returns the selected port, or `-1` when no port can be bound
2935
+ * or another error occurs.
2936
+ *
2937
+ * When `ClientIpAddress` is empty, the listener binds to all interfaces: `0.0.0.0` when the
2938
+ * shared `ListenIpv6`/`PreferIpv6` setting is `false`, or `::` when it is `true`. Set
2939
+ * `ClientIpAddress` to a numeric local address to bind only to that interface; the explicit
2940
+ * address determines the address family.
2941
+ *
2942
+ * `backLog` is the requested operating-system pending-connection queue length. The operating
2943
+ * system may cap or adjust it.
2944
+ *
2945
+ * **Next step:** After a port is successfully selected, call `AcceptNext` to accept incoming
2946
+ * connections. For TLS listeners, complete `AddSslAcceptableClientCaDn`, if needed, and
2947
+ * `InitSslServer` before calling this method.
2948
+ *
2949
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
2950
+ * {@link Socket.bindAndListenPortRangeAsync}.
2951
+ */
2952
+ bindAndListenPortRange(beginPort: number, endPort: number, backLog: number): number
2953
+
2954
+ /**
2955
+ * Asynchronous form of {@link Socket.bindAndListenPortRange}: the same call on a native worker
2956
+ * thread,
2957
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
2958
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
2959
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
2960
+ */
2961
+ bindAndListenPortRangeAsync(beginPort: number, endPort: number, backLog: number): Promise<number>
2962
+
2963
+ /**
2964
+ * Reads bytes until `lookForByte` is encountered and appends all bytes
2965
+ * up to and including the matching byte to `bd`. The delimiter must be
2966
+ * an integer from `0` through `255` and is matched as a raw
2967
+ * byte value.
2968
+ *
2969
+ * **Partial data remains on failure:**
2970
+ * If the delimiter is not found before a timeout, application abort, peer close,
2971
+ * or connection reset, the method returns `false`, but everything
2972
+ * received while searching remains appended to `bd`. These bytes are
2973
+ * included in `ReceivedCount`, have been consumed from the connection,
2974
+ * and are not retained internally for a later receive call.
2975
+ *
2976
+ * A timeout or application abort generally leaves the connection open. A peer
2977
+ * close or reset leaves it unavailable for further I/O.
2978
+ *
2979
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
2980
+ * {@link Socket.receiveUntilByteBdAsync}.
2981
+ *
2982
+ * @throws Error if the call fails (the message names the reason); the full log is in
2983
+ * {@link Socket.lastErrorText}.
2984
+ */
2985
+ receiveUntilByteBd(lookForByte: number, bd: BinData): void
2986
+
2987
+ /**
2988
+ * Asynchronous form of {@link Socket.receiveUntilByteBd}: the same call on a native worker
2989
+ * thread,
2990
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
2991
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
2992
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
2993
+ *
2994
+ * The promise rejects with an Error if the call fails; the full log is in
2995
+ * {@link Socket.lastErrorText}.
2996
+ */
2997
+ receiveUntilByteBdAsync(lookForByte: number, bd: BinData): Promise<void>
2998
+
2999
+ /**
3000
+ * Sends the same Wake-on-LAN magic packet as `SendWakeOnLan` and appends a SecureOn password.
3001
+ * `password` is a hexadecimal string representing four or six bytes.
3002
+ *
3003
+ * **Important:** SecureOn is an optional Wake-on-LAN password field, not encryption and not
3004
+ * strong authentication. Support and expected length are device-specific.
3005
+ *
3006
+ * @throws Error if the call fails (the message names the reason); the full log is in
3007
+ * {@link Socket.lastErrorText}.
3008
+ */
3009
+ sendWakeOnLan2(macAddress: string, port: number, ipBroadcastAddr: string, password: string): void
3010
+
3011
+ /**
3012
+ * Moves the active connection from `cSocket` into this object. This object first releases its
3013
+ * reference to any connection it previously held. Unlike `TakeSocket`, this method does not add a
3014
+ * member to a socket set.
3015
+ *
3016
+ * After success, `cSocket` holds no connection. It may be closed, destroyed, or reused
3017
+ * immediately without affecting the transferred connection. Ownership is exclusive after the
3018
+ * move; only this destination object controls the transferred connection.
3019
+ *
3020
+ * **Move semantics:** This method transfers ownership rather than sharing the connection. Use
3021
+ * `DupSocket` only when two wrappers must refer to the same underlying connection.
3022
+ *
3023
+ * @throws Error if the call fails (the message names the reason); the full log is in
3024
+ * {@link Socket.lastErrorText}.
3025
+ */
3026
+ takeConnection(sock: Socket): void
3027
+
3028
+ /**
3029
+ * Restarts one direction of connection-level transfer-rate measurement. Set `rcvPerf` to `true`
3030
+ * to reset receive measurement for `RcvBytesPerSec`; set it to `false` to reset send measurement
3031
+ * for `SendBytesPerSec`.
3032
+ */
3033
+ resetPerf(rcvPerf: boolean): void
3034
+
3035
+ /**
3036
+ * Sends `szByteData` bytes beginning at the memory address `pByteData`. This is the C/C++
3037
+ * pointer-and-length form of `SendBytes`.
3038
+ *
3039
+ * **Important:** The caller must provide a valid buffer containing at least `szByteData` readable
3040
+ * bytes for the duration of the call.
3041
+ *
3042
+ * @throws Error if the call fails (the message names the reason); the full log is in
3043
+ * {@link Socket.lastErrorText}.
3044
+ */
3045
+ sendBytes2(byteData: ArrayBuffer): void
3046
+
3047
+ /**
3048
+ * Receives bytes until the exact byte sequence represented by
3049
+ * `matchStr` is found. Chilkat first encodes
3050
+ * `matchStr` using `StringCharset`, then performs a
3051
+ * case-sensitive, byte-for-byte comparison against the incoming stream. The
3052
+ * match may span multiple underlying network reads.
3053
+ *
3054
+ * After the delimiter is found, the accumulated bytes are decoded using
3055
+ * `StringCharset` and appended to `sb`. The appended text
3056
+ * includes the matching delimiter.
3057
+ *
3058
+ * **Empty match strings:**
3059
+ * If `matchStr` is empty, or if it encodes to zero bytes under the
3060
+ * current `StringCharset`, the method fails immediately with
3061
+ * `ReceiveFailReason = 4`. No data is read and `sb` is
3062
+ * left unchanged.
3063
+ *
3064
+ * **The destination remains unchanged on failure:**
3065
+ * If the match is not found before a timeout, application abort, peer close,
3066
+ * connection reset, or other failure, the method returns `false` and
3067
+ * does not modify `sb`. Bytes consumed while searching are included
3068
+ * in `ReceivedCount`, are discarded, are not retained for a later
3069
+ * receive, and cannot be recovered. If an orderly peer close is detected,
3070
+ * `ReceiveFailReason` is `10`.
3071
+ *
3072
+ * On success, bytes read beyond the delimiter may remain buffered internally
3073
+ * for the next receive operation.
3074
+ *
3075
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
3076
+ * {@link Socket.receiveUntilMatchSbAsync}.
3077
+ *
3078
+ * @throws Error if the call fails (the message names the reason); the full log is in
3079
+ * {@link Socket.lastErrorText}.
3080
+ */
3081
+ receiveUntilMatchSb(matchStr: string, sb: StringBuilder): void
3082
+
3083
+ /**
3084
+ * Asynchronous form of {@link Socket.receiveUntilMatchSb}: the same call on a native worker
3085
+ * thread,
3086
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
3087
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
3088
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
3089
+ *
3090
+ * The promise rejects with an Error if the call fails; the full log is in
3091
+ * {@link Socket.lastErrorText}.
3092
+ */
3093
+ receiveUntilMatchSbAsync(matchStr: string, sb: StringBuilder): Promise<void>
3094
+
3095
+ /**
3096
+ * Populates `json` with information about local network adapters, including IPv4 addresses, IPv6
3097
+ * addresses, and MAC addresses. Existing contents of the destination JSON object are replaced or
3098
+ * populated according to the returned structure.
3099
+ *
3100
+ * **Note:** Adapter data is local system configuration. It does not identify the public Internet
3101
+ * address seen through NAT.
3102
+ *
3103
+ * @throws Error if the call fails (the message names the reason); the full log is in
3104
+ * {@link Socket.lastErrorText}.
3105
+ */
3106
+ getAdaptersAddresses(json: JsonObject): void
3107
+
3108
+ /**
3109
+ * Copies additional JSON details from the most recently called method into `json`, when that
3110
+ * method produced such information. Many methods produce an empty result.
3111
+ *
3112
+ * **Important:** Call this immediately after the operation of interest. Any intervening method
3113
+ * call can replace the stored details.
3114
+ */
3115
+ getLastJsonData(json: JsonObject): void
3116
+
3117
+ /**
3118
+ * Copies the certificate presented by the remote TLS server into `cert` for the current
3119
+ * client-side TLS connection. The method returns `false` when the socket is not connected, is not
3120
+ * using TLS, or no server certificate is available.
3121
+ *
3122
+ * **Note:** Retrieving the certificate does not itself establish trust. Use
3123
+ * `RequireSslCertVerify` and/or `TlsPinSet` when validation is required.
3124
+ *
3125
+ * @throws Error if the call fails (the message names the reason); the full log is in
3126
+ * {@link Socket.lastErrorText}.
3127
+ */
3128
+ getServerCert(cert: Cert): void
3129
+
3130
+ /**
3131
+ * Waits for and accepts the next incoming connection on a socket previously configured by
3132
+ * `BindAndListen` or `BindAndListenPortRange`. For a TLS listener, acceptance includes the
3133
+ * server-side TLS handshake.
3134
+ *
3135
+ * - `maxWaitMs = 0` waits indefinitely for an incoming connection.
3136
+ *
3137
+ * - A positive value waits up to that many milliseconds.
3138
+ *
3139
+ * - Negative values have no defined meaning and should not be used.
3140
+ *
3141
+ * **Destination replacement:** On success, the accepted connection replaces any connection
3142
+ * already owned by `socket`; a prior call to `Close` is not required. The destination keeps its
3143
+ * existing property values, while only its connection is replaced. If the destination is actively
3144
+ * performing another operation, the accept fails rather than interrupting that operation.
3145
+ *
3146
+ * **Failure is non-destructive:** On any failure, including a timeout, missing listener, or TLS
3147
+ * handshake failure, the destination `socket` is left completely unchanged. The listening socket
3148
+ * also remains active after a timeout or a per-client TLS failure, so the application may
3149
+ * immediately call `AcceptNext` again without rebinding.
3150
+ *
3151
+ * The accepted connection is independent of the listener and all other accepted connections.
3152
+ * Listener properties are not copied to the accepted socket. Configure the destination before or
3153
+ * after a successful accept as needed.
3154
+ *
3155
+ * SettingInherited from listener?
3156
+ *
3157
+ * | `MaxReadIdleMs` / `MaxSendIdleMs` | | No |
3158
+ *
3159
+ * | Verbose logging and debug-log path | | No |
3160
+ *
3161
+ * | Upload/download bandwidth throttling | | No |
3162
+ *
3163
+ * | Socket buffers and TCP no-delay options | | No |
3164
+ *
3165
+ * | `SslAllowedCiphers` / `SslProtocol` | | No |
3166
+ *
3167
+ * **TLS state:** The server certificate configuration created by `InitSslServer` remains on the
3168
+ * listener and is used for each handshake. The accepted socket contains that connection's
3169
+ * negotiated TLS state, peer information, and any received client certificate. Examine those
3170
+ * values on the accepted socket.
3171
+ *
3172
+ * **TLS handshake timeout:** `maxWaitMs` governs the wait for the incoming TCP connection.
3173
+ * Handshake inactivity is governed by `MaxReadIdleMs` and `MaxSendIdleMs` on the listener.
3174
+ *
3175
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
3176
+ * {@link Socket.acceptNextAsync}.
3177
+ *
3178
+ * @throws Error if the call fails (the message names the reason); the full log is in
3179
+ * {@link Socket.lastErrorText}.
3180
+ */
3181
+ acceptNext(maxWaitMs: number, socket: Socket): void
3182
+
3183
+ /**
3184
+ * Asynchronous form of {@link Socket.acceptNext}: the same call on a native worker thread,
3185
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
3186
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
3187
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
3188
+ *
3189
+ * The promise rejects with an Error if the call fails; the full log is in
3190
+ * {@link Socket.lastErrorText}.
3191
+ */
3192
+ acceptNextAsync(maxWaitMs: number, socket: Socket): Promise<void>
3193
+
3194
+ /**
3195
+ * Populates `dest` with another `Socket` wrapper that shares this object's underlying connection.
3196
+ * The destination first releases its reference to any connection it previously held. The shared
3197
+ * connection object is reference-counted, but all wrappers operate on the same live connection
3198
+ * and byte stream.
3199
+ *
3200
+ * The reference count keeps the underlying connection object alive while wrappers still refer to
3201
+ * it; it does not prevent an explicit `Close` from shutting down the connection. TLS state, TLS
3202
+ * conversion state, and the internal receive/over-read buffer are shared. A TLS renegotiation,
3203
+ * `ConvertToSsl`, or `ConvertFromSsl` through one wrapper changes the connection seen by every
3204
+ * duplicate. Bytes buffered through one wrapper may be consumed by a receive through another.
3205
+ *
3206
+ * State, setting, or resultScope after `DupSocket`
3207
+ *
3208
+ * | Underlying connection, byte stream, TLS session, TLS conversion state, and receive buffer | |
3209
+ * Shared by all duplicates. |
3210
+ *
3211
+ * | `ReceivedCount` | | Shared connection-level counter. All duplicates report the same
3212
+ * cumulative value, and resetting it through one wrapper resets the value seen by the others. |
3213
+ *
3214
+ * | `SendBytesPerSec` and `RcvBytesPerSec` | | Shared connection-level measurements. Calling
3215
+ * `ResetPerf` through one wrapper resets the selected measurement for every duplicate. |
3216
+ *
3217
+ * | `KeepSessionLog`, `SessionLog`, and session logging | | Per wrapper. Enabling logging on one
3218
+ * duplicate does not enable it on another. Each wrapper logs only traffic that passes through it,
3219
+ * and reading or clearing one wrapper's log does not affect another wrapper's log. |
3220
+ *
3221
+ * | `LastMethodFailed`, `AcceptFailReason`, `ReceiveFailReason`, `SendFailReason`, and
3222
+ * `ReceivedInt` | | Per wrapper. An operation performed through one duplicate does not update
3223
+ * these values on another duplicate. |
3224
+ *
3225
+ * **Close affects every duplicate:**
3226
+ * Calling `Close` on any wrapper actively closes the shared connection for all wrappers. The
3227
+ * other wrapper objects remain alive, but subsequent I/O through them fails because the shared
3228
+ * connection is closed.
3229
+ *
3230
+ * **Threading pattern:** Duplicates are intended to permit one reader and one writer to use the
3231
+ * same connection. Two concurrent readers compete for the same stream and shared receive buffer
3232
+ * and should be avoided.
3233
+ *
3234
+ * **Release rule:** When one duplicate is no longer needed but another must continue using the
3235
+ * connection, release, destroy, delete, or allow the unused wrapper to be garbage-collected
3236
+ * without calling `Close`. This drops only that wrapper's reference and leaves the connection
3237
+ * usable through the remaining duplicates. Call `Close` on any one wrapper only when the shared
3238
+ * connection should end for everyone.
3239
+ *
3240
+ * @throws Error if the call fails (the message names the reason); the full log is in
3241
+ * {@link Socket.lastErrorText}.
3242
+ */
3243
+ dupSocket(dest: Socket): void
3244
+
3245
+ /**
3246
+ * Copies the TLS server certificate configured by `InitSslServer` into `cert`. This method is
3247
+ * intended for a socket acting as a TLS server and returns `false` when no server certificate has
3248
+ * been configured.
3249
+ *
3250
+ * @throws Error if the call fails (the message names the reason); the full log is in
3251
+ * {@link Socket.lastErrorText}.
3252
+ */
3253
+ getMyServerCert(cert: Cert): void
3254
+
3255
+ /**
3256
+ * Copies the client certificate at zero-based `index` into `cert` from the TLS handshake of an
3257
+ * accepted server-side connection. Use `NumReceivedClientCerts` to determine the valid index
3258
+ * range.
3259
+ *
3260
+ * Client certificates are normally supplied only when the server requests mutual TLS
3261
+ * authentication. The application can inspect the returned certificate and close the connection
3262
+ * when it does not satisfy authorization requirements.
3263
+ *
3264
+ * **Important:** Call this method on the accepted connection object populated by `AcceptNext`,
3265
+ * not on the listener socket.
3266
+ *
3267
+ * @throws Error if the call fails (the message names the reason); the full log is in
3268
+ * {@link Socket.lastErrorText}.
3269
+ */
3270
+ getRcvdClientCert(index: number, cert: Cert): void
3271
+
3272
+ /**
3273
+ * Opens a new port-forwarded channel through the authenticated SSH tunnel to
3274
+ * `hostname`:`port` and populates `channel` with
3275
+ * the connected socket. If `ssl` is `true`, Chilkat establishes TLS
3276
+ * to the destination inside the SSH tunnel.
3277
+ *
3278
+ * - `maxWaitMs = 0` waits indefinitely for the channel/destination connection to open.
3279
+ *
3280
+ * - A positive value is used as supplied; unlike `Connect`, values below `100` milliseconds are
3281
+ * not raised to a 100-millisecond minimum.
3282
+ *
3283
+ * - Negative values have no defined meaning and should not be used.
3284
+ *
3285
+ * Multiple channels can share one authenticated SSH tunnel and can target
3286
+ * different destination host/port pairs.
3287
+ *
3288
+ * **Required sequence:**
3289
+ * Call `SshOpenTunnel` and authenticate successfully before opening
3290
+ * channels.
3291
+ *
3292
+ * This call blocks the JavaScript thread until Chilkat returns; from UI code prefer
3293
+ * {@link Socket.sshNewChannelAsync}.
3294
+ *
3295
+ * @throws Error if the call fails (the message names the reason); the full log is in
3296
+ * {@link Socket.lastErrorText}.
3297
+ */
3298
+ sshNewChannel(hostname: string, port: number, ssl: boolean, maxWaitMs: number, channel: Socket): void
3299
+
3300
+ /**
3301
+ * Asynchronous form of {@link Socket.sshNewChannel}: the same call on a native worker thread,
3302
+ * settling on the JavaScript thread. While it is pending, other calls on this object throw,
3303
+ * except {@link Socket.abort} (which cancels it) and the {@link Socket.onPercentDone} /
3304
+ * {@link Socket.onProgressInfo} callbacks, which report progress while it runs.
3305
+ *
3306
+ * The promise rejects with an Error if the call fails; the full log is in
3307
+ * {@link Socket.lastErrorText}.
3308
+ */
3309
+ sshNewChannelAsync(hostname: string, port: number, ssl: boolean, maxWaitMs: number, channel: Socket): Promise<void>
3310
+
3311
+ // ---- Events (ReactNativeGen_DESIGN.md §6) ----
3312
+
3313
+ /**
3314
+ * Called with the percent completed (0..100) while a long-running method runs, when Chilkat
3315
+ * can measure progress. Runs on the JavaScript thread, so it is only useful with the
3316
+ * `...Async` methods (during a synchronous call the thread is busy and the events arrive
3317
+ * after it returns). Assign `undefined` to remove.
3318
+ */
3319
+ onPercentDone?: (pctDone: number) => void
3320
+
3321
+ /**
3322
+ * Called with a name/value pair of progress information while a long-running method runs
3323
+ * (what is reported depends on the class and method). Runs on the JavaScript thread; see
3324
+ * {@link Socket.onPercentDone}. Assign `undefined` to remove.
3325
+ */
3326
+ onProgressInfo?: (name: string, value: string) => void
3327
+
3328
+ /**
3329
+ * Requests that the pending `...Async` call on this object stop at its next progress check.
3330
+ * The promise then rejects with Chilkat's abort error. Chilkat checks at least every
3331
+ * `heartbeatMs` milliseconds on the classes that have that property, so set it (e.g. 250)
3332
+ * for a responsive cancel. Harmless when nothing is pending.
3333
+ */
3334
+ abort(): void
3335
+ }