Jaxer.Socket : Object
Return to: Jaxer Framework index

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

Platform Support

Jaxer Server FrameworkJaxer Client Framework
1.0no

Constructors

ConstructorActionJaxer Server FrameworkJaxer Client Framework
Jaxer.Socket Constructor() : Jaxer.Socket
The constructor of a network socket object used for character-based (non-binary) operations
Show Details1.0no

Jaxer.Socket() : Jaxer.Socket

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

Returns
Jaxer.SocketReturns an instance of Socket.

Functions

MethodActionJaxer Server FrameworkJaxer Client Framework
available() : Number
How many bytes (not characters) are currently available on the stream?
Show Details1.0no

Returns
Numberthe number of bytes available

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

Parameters
StringhostThe host to connect to
NumberportThe port on which to connect

readLine() : String
Read a single line from the socket
Show Details1.0no

Returns
StringThe text read in

readString(Number count) : String
Read characters from the socket into a string
Show Details1.0no

Parameters
NumbercountHow many characters to read

Returns
StringThe text read in

writeString(String data) : void
Write a string to the socket
Show Details1.0no

Parameters
StringdataThe text to write

aptana_docs