Socket Object

Description

A TCP socket.

Sockets are currently used for most network communications.

You can use this object as an HTTP, SMTP, Whois, Telnet client, or for some custom use of your own.

Methods

Connect

IsConnected

Close

Timeout(Get)

Timeout(Set)

PeerIPAddress

AtEndOfStream

IsDataAvailable

Read

ReadBinary

IsDataAvailable

ReadLine

CountDataAvailable

ReadAmount

ReadAmountBinary

Write

WriteBinary

Example

set s = CreateObject("Toolsack.Socket")
s.Connect "www.microsoft.com", 80
 
q = "GET / HTTP/1.0" & vbcrlf
q = q & "host: www.microsoft.com" & vbcrlf
q = q & vbcrlf
s.Write q
t = s.ReadAmount(-1)
msgbox t
 

Samples

Client Server - Client and server applications to transfer files over a socket connection.

Web Server - Uses Socket Classes to create a simple web server.

Whois Client - Use a socket to do whois lookups.

Articles

SMTP Troubleshooting - Describes the SMTP protocol and how to spy on it to track down problems.



We always want to hear your feedback. Send to feedback@toolsack.com.
© 2000-2001 Toolsack Software Ltd.