This class represents a client TCP socket.
A socket is an endpoint for communication between two machines.
TCP (Transmission Control Protocol) is a connection-oriented, reliable byte-stream protocol of the TCP/IP protocol suite.
Defined in: Socket.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
jls.net.Socket(host, port)
Creates a TCP socket.
|
| Method Attributes | Method Name and Description |
|---|---|
|
close()
Closes this socket.
|
|
|
configureBlocking(block)
Adjusts this socket's blocking mode.
|
|
|
connect(endpoint)
Connects this socket to the server.
|
|
|
flush()
Flushs this socket.
|
|
|
read(buffer)
Reads a sequence of bytes from this channel into the given buffer.
|
|
|
readByte()
Reads a byte.
|
|
|
readByteArray(barray, offset, length)
Reads bytes into the specified byte array, starting at the given offset.
|
|
|
write(buffer)
Writes a sequence of bytes to this channel from the given buffer.
|
|
|
writeByte(b)
Writes a byte.
|
|
|
writeByteArray(barray, offset, length)
Writes bytes from the specified byte array starting at the given offset.
|