FoxPro Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

Visual FoxPro Examples

Bounced Mail
Bz2
Character Encoding
CSV
Digital Certificates
Digital Signatures
Email
FTP
HTML-to-XML
HTTP
IMAP
Encryption
MHT / HTML Email
POP3
RSA
S/MIME
Socket
Spider
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
String
Tar
Upload
XML
XMP
Zip Compression
Self-Extractor

More Examples...
Email Object
RSS
Atom
Byte Array
Service
PPMD
Deflate
DH Key Exchange
DSA

Unreleased...
FileAccess
Bzip2
LZW
Icon

 

Non-Chilkat Links
Text and String Handling

Accept Connection on Socket

Demonstrates how to create a TCP/IP socket, listen on a port, accept an incoming connection, and send a "Hello World" message to the client.

Download Chilkat Socket ActiveX

LOCAL loListenSocket
LOCAL lnSuccess
LOCAL loConnectedSocket

loListenSocket = CreateObject('Chilkat.Socket')

lnSuccess = loListenSocket.UnlockComponent("Anything for 30-day trial")
IF (lnSuccess <> 1) THEN
    =MESSAGEBOX("Failed to unlock component")
    QUIT
ENDIF

*  Bind to a port and listen for incoming connections:
*  This example will listen at port 5555 and allows for a backlog
*  of 25 pending connection requests.
lnSuccess = loListenSocket.BindAndListen(5555,25)
IF (lnSuccess <> 1) THEN
    =MESSAGEBOX(loListenSocket.LastErrorText)
    QUIT
ENDIF

*  Get the next incoming connection
*  Wait a maximum of 20 seconds (20000 millisec)

loConnectedSocket = loListenSocket.AcceptNextConnection(20000)
IF (loConnectedSocket = NULL ) THEN
    =MESSAGEBOX(loListenSocket.LastErrorText)
    QUIT
ENDIF

*  Set maximum timeouts for reading an writing (in millisec)
loConnectedSocket.MaxReadIdleMs = 10000
loConnectedSocket.MaxSendIdleMs = 10000

*  Send a "Hello World!" message to the client:
lnSuccess = loConnectedSocket.SendString("Hello World!")
IF (lnSuccess <> 1) THEN
    =MESSAGEBOX(loConnectedSocket.LastErrorText)
    RELEASE loConnectedSocket
    QUIT
ENDIF

*  Close the connection with the client.
*  Wait a max of 20 seconds (20000 millsec)
loConnectedSocket.Close(20000)

=MESSAGEBOX("success!")

Need a specific example? Send a request to support@chilkatsoft.com

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

Mail Component · .NET Email Component · ASP Mail Component · XML Parser