Socket.isConnected

From Spheriki

Jump to: navigation, search

Checks if the socket is connected.


Contents

Usage

boolean Socket.isConnected();
  • Socket Sphere Socket object to check connection of.
  • boolean is returned, true if the socket is connected, false otherwise.


Examples

See examples for ListenOnPort() and OpenAddress().


Notes

  • If a socket is connected, it means that data can be sent to and receieved from it, using the Socket.write() and Socket.read() functions respectively.
  • This function is important to ensure that a connection has been established before you try to use the socket. See the examples for how this can be done.


See also

Personal tools