Socket.write

From Spheriki

Jump to: navigation, search

Writes the data of the given ByteArray into the socket.


Contents

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.


Examples

See example for ListenOnPort(). Refer to the third step (// 3. If connected, send our data.).


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.
  • Obviously, the socket needs to be open and connected for this function to work properly.


See also

Personal tools