Socket.write
From Spheriki
Writes the data of the given ByteArray into the socket.
Contents |
[edit]
Usage
Socket.write(data);
- Socket Sphere Socket object. The channel into which the data should be written into.
- data Sphere ByteArray object. The byte array holding the data to write into the socket.
[edit]
Examples
See example for ListenOnPort(). Refer to the third step (// 3. If connected, send our data.).
[edit]
Notes
- If the socket is connected to another computer via a network, this data will be sent over the network to that computer.
- The data sent by this function will need to be received at the other end. The corresponding function Socket.read() is capable of this.
- To provide the data for this function, strings can be converted into ByteArray objects using CreateByteArrayFromString().
- Obviously, the socket needs to be open and connected for this function to work properly.
[edit]
See also
- Sphere Socket object
- Sphere ByteArray object
- CreateByteArrayFromString()
- ListenOnPort()

