![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(PowerBuilder) Example: Socket.AcceptNext methodDemonstrates how to call the AcceptNext method. Note: This example requires Chilkat v11.0.0 or greater.
integer li_rc oleobject loo_ListenSocket oleobject loo_ConnectedSocket integer li_Port integer li_Backlog integer li_Success integer li_MaxWaitMs loo_ListenSocket = create oleobject li_rc = loo_ListenSocket.ConnectToNewObject("Chilkat.Socket") if li_rc < 0 then destroy loo_ListenSocket MessageBox("Error","Connecting to COM object failed") return end if loo_ConnectedSocket = create oleobject li_rc = loo_ConnectedSocket.ConnectToNewObject("Chilkat.Socket") li_Port = 5555 li_Backlog = 25 li_Success = loo_ListenSocket.BindAndListen(li_Port,li_Backlog) if li_Success = 0 then Write-Debug loo_ListenSocket.LastErrorText destroy loo_ListenSocket destroy loo_ConnectedSocket return end if // Accept next incoming connection li_MaxWaitMs = 200000 li_Success = loo_ListenSocket.AcceptNext(li_MaxWaitMs,loo_ConnectedSocket) if li_Success = 0 then Write-Debug loo_ListenSocket.LastErrorText destroy loo_ListenSocket destroy loo_ConnectedSocket return end if // ... // ... li_MaxWaitMs = 20000 loo_ConnectedSocket.Close() destroy loo_ListenSocket destroy loo_ConnectedSocket |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.