Core JavaScriptExtendScript only
Object

Socket

Creates a TCP/IP connection, or establishes a TCP/IP server.

Properties

NameType AccessDescription
Boolean readonly When true, the connection is active.
String read/write Sets or retrieves the name of the encoding used to transmit data.
Boolean readonly When true, the receive buffer is empty.
String read/write A message describing the most recent error. Setting this value clears any error message.
String readonly The name of the remote computer when a connection is established.
Number = 10 read/write The timeout in seconds to be applied to read or write operations.

Methods

Socket

Creates a new Socket object.

Boolean

Terminates the open connection.

Boolean

Instructs the object to start listening for an incoming connection.

port Number 1–65535 The TCP/IP port number to listen on.
encoding? String The encoding to be used for the connection
Boolean

Opens the connection for subsequent read/write operations.

host String The server to connect to.
encoding? String The encoding to be used for the connection
Socket

Checks a listening object for a new incoming connection.

String

Reads up to the specified number of characters from the connection. CR characters are ignored unless the encoding is set to "BINARY".

count? Number The number of characters to read.
String

Reads one line of text up to the next line feed.

Boolean

Concatenates all arguments into a single string and writes that string to the connection.

text String Any number of string values. All arguments are concatenated to form the string to be written. CRLF sequences are converted to LFs unless the encoding is set to "BINARY".
Boolean

Concatenates all arguments into a single string, appends a LF character, and writes that string to the connection.

text String Any number of string values. All arguments are concatenated to form the string to be written. CRLF sequences are converted to LFs unless the encoding is set to "BINARY".

Return 2

Methods that return a Socket.