Chilkat HOME Android™ Classic ASP C C++ C# Mono C# .NET Core C# C# UWP/WinRT DataFlex Delphi ActiveX Delphi DLL Visual FoxPro Java Lianja MFC Objective-C Perl PHP ActiveX PHP Extension PowerBuilder PowerShell PureBasic CkPython Chilkat2-Python Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ Visual Basic 6.0 VB.NET VB.NET UWP/WinRT VBScript Xojo Plugin Node.js Excel Go
(VB.NET UWP/WinRT) Send Bytes on a Socket ConnectionDemonstrates how to send a mixture of binary (non-text) and text bytes on a socket connection.
' This example requires the Chilkat API to have been previously unlocked. ' See Global Unlock Sample for sample code. Dim socket As New Chilkat.Socket ' Connect to some host:port Dim ssl As Boolean = False Dim maxWaitMillisec As Integer = 20000 Dim port As Integer = 5555 Dim success As Boolean = Await socket.ConnectAsync("test.com",port,ssl,maxWaitMillisec) If (success <> True) Then Debug.WriteLine(socket.LastErrorText) Exit Sub End If ' We wish to send a 0x00 byte followed by the us-ascii string "10800" Dim bd As New Chilkat.BinData bd.AppendByte(0) bd.AppendString("10800","utf-8") ' Send the entire contents of bd. success = Await socket.SendBdAsync(bd,0,0) If (success <> True) Then Debug.WriteLine(socket.LastErrorText) Exit Sub End If |
© 2000-2022 Chilkat Software, Inc. All Rights Reserved.