Jaxer.Socket : Object
Return to: Jaxer Framework index

Network socket utility object for simple character-based (non-binary) socket access.

Platform Support

Jaxer Server Framework Jaxer Client Framework
1.0 no

Constructors

Constructor Action Jaxer Server Framework Jaxer Client Framework
Jaxer.Socket Constructor() : Jaxer.Socket
The constructor of a network socket object used for character-based (non-binary) operations
Show Details 1.0 no

Jaxer.Socket() : Jaxer.Socket

The constructor of a network socket object used for character-based (non-binary) operations

Returns
Jaxer.Socket Returns an instance of Socket.

Functions

Method Action Jaxer Server Framework Jaxer Client Framework
available() : Number
How many bytes (not characters) are currently available on the stream?
Show Details 1.0 no

Returns
Number the number of bytes available

close() : void
Close the socket
No Details 1.0 no
flush() : void
Flush the socket's output stream
No Details 1.0 no
open(String host, Number port) : void
Open the socket for communication
Show Details 1.0 no

Parameters
String host The host to connect to
Number port The port on which to connect

readLine() : String
Read a single line from the socket
Show Details 1.0 no

Returns
String The text read in

readString(Number count) : String
Read characters from the socket into a string
Show Details 1.0 no

Parameters
Number count How many characters to read

Returns
String The text read in

writeString(String data) : void
Write a string to the socket
Show Details 1.0 no

Parameters
String data The text to write

aptana_docs