Chilkat Examples

ChilkatHOMEAndroid™AutoItCC#C++Chilkat2-PythonCkPythonClassic ASPDataFlexDelphi DLLGoJavaNode.jsObjective-CPHP ExtensionPerlPowerBuilderPowerShellPureBasicRubySQL ServerSwiftTclUnicode CUnicode C++VB.NETVBScriptVisual Basic 6.0Visual FoxProXojo Plugin

VB.NET Examples
Web API Categories

ASN.1
AWS KMS
AWS Misc
Amazon EC2
Amazon Glacier
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Async
Azure Cloud Storage
Azure Key Vault
Azure Service Bus
Azure Table Service
Base64
Box
CAdES
CSR
CSV
Cert Store
Certificates
Cloud Signature CSC
Code Signing
Compression
DKIM / DomainKey
DNS
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
EBICS
ECC
Ed25519
Email Object
Encryption
FTP
FileAccess
Firebase
GMail REST API
GMail SMTP/IMAP/POP
Geolocation
Google APIs
Google Calendar
Google Cloud SQL
Google Cloud Storage
Google Drive
Google Photos
Google Sheets
Google Tasks
Gzip
HTML-to-XML/Text
HTTP
HTTP Misc
IMAP
JSON
JSON Web Encryption (JWE)
JSON Web Signatures (JWS)
JSON Web Token (JWT)
Java KeyStore (JKS)
MHT / HTML Email
MIME
Microsoft Graph
Misc
NTLM
OAuth1
OAuth2
OIDC
Office365
OneDrive
OpenSSL
Outlook
Outlook Calendar
Outlook Contact
PDF Signatures
PEM
PFX/P12
PKCS11
POP3
PRNG
REST
REST Misc
RSA
SCP
SCard
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
ScMinidriver
Secrets
SharePoint
SharePoint Online
Signing in the Cloud
Socket/SSL/TLS
Spider
Stream
Tar Archive
ULID/UUID
Upload
WebSocket
X
XAdES
XML
XML Digital Signatures
XMP
Zip
curl
uncategorized

 

 

 

(VB.NET) Example: Socket.DupSocket method

See more Socket/SSL/TLS Examples
Demonstrates how to call the DupSocket method.

Note: This example requires Chilkat v11.0.0 or greater.

Chilkat .NET Downloads

Chilkat .NET Framework

Chilkat for .NET Core

Dim socket As New Chilkat.Socket
Dim success As Boolean = socket.Connect("example.com",443,True,5000)

' ...
' ...

' Duplicate the socket to share the same connection across threads.
' In a multithreaded application, each thread should use its own socket object. For example:

' - The main thread can use the original socket for reading.
' - A secondary thread can use a duplicate for writing.
' - Another thread can use a separate duplicate to monitor the connection status.

Dim socket_for_sending As New Chilkat.Socket
success = socket.DupSocket(socket_for_sending)
If (success = False) Then
    Debug.WriteLine(socket.LastErrorText)
    Exit Sub
End If


Dim socket_for_monitor As New Chilkat.Socket
success = socket.DupSocket(socket_for_monitor)
If (success = False) Then
    Debug.WriteLine(socket.LastErrorText)
    Exit Sub
End If


' All three socket objects: socket, socket_for_sending, and socket_for_monitor share the same underlying connection.

 

© 2000-2025 Chilkat Software, Inc. All Rights Reserved.