w3Sockets Reference

Reference


 socket.tcp
    Buffer : String
    DoTelnetEmulation : Boolean
    Host : String
    TelnetEmulation : String
    TimeOut : Integer
    Close() : 
    GetLine() : String
    GetText( len ) : String
    Open() : 
    SendLine( Line ) : 
    SendText( text ) : 
    Wait() : 
    WaitFor( Substring ) : Boolean
    WaitForDisconnect() : 


Properties

  Buffer : String
(v1.0)
Used to get the data received during some Wait functions
Response.Write( socket.buffer );

  DoTelnetEmulation : Boolean
(v1.0)
Boolean value that can be used to instruct w3 Sockets to respond to telnet queries
socket.DoTelnetemulation = true

  Host : String
(v1.0)
Text string representing the host and port you want to connect to. This is in the form of " : "
socket.host = "www.eu.microsoft.com:80"

  TelnetEmulation : String
(v1.0)
Type of terminal to emulate

  TimeOut : Integer
(v1.0)
Default timeout for all operations in miliseconds
socket.timeout = 5000; // Five seconds

Methods

  Close()
(v1.0)
Closes an active connection
socket.close();

  GetLine()  : String
(v1.0)
Waits and returns one row of data
line = socket.GetLine();

  GetText(len)  : String
(v1.0)
Returns [Len] characters from the socket
Response.Write( Socket.GetText( 5 ) );

  Open()
(v1.0)
Initiates a connection with "host"
socket.Open();

  SendLine(Line)
(v1.0)
Sends a line of data and appends a crlf at the end
socket.sendLine( "GET /" );

  SendText(text)
(v1.0)
Sends a text string without linebreaks
Socket.SendText( "Hello world" );

  Wait()
(v1.0)
Waits until data is returned
socket.wait();

  WaitFor(Substring)  : Boolean
(v1.0)
Waits for a specifit string and then returns
socket.waitfor( "login:" );

  WaitForDisconnect()
(v1.0)
Waits until all data is received and the connection is closed. The data can then be read from the "buffer" property
socket.WaitForDisconnect();