Returns the device IP address. Preferably the wifi address. Returns 127.0.0.1 if there is no ip address.
GetMyWifiIpAsString
Returns the wifi address. Returns 127.0.0.1 if there is no ip address.
Initialize (PortAsInt, EventNameAsString)
Initializes the server socket and binds it to the given port.
IsInitializedAsBoolean
Listen
Starts listening for incoming connections. The NewConnection event will be raised when there is a new connection. Calling Listen when the server is already listening will not do anything.
Closes the socket and the streams. It is safe to call this method multiple times.
Connect (HostAsString, PortAsInt, TimeoutAsInt)
Tries to to connect to the given address. The Connected event will be raised when operation completes. Host - The host name or ip address. Port - Port number. Timeout - Connection timeout measured in milliseconds. Pass 0 to disable the timeout.
ConnectedAsBoolean [read only]
Returns true if the socket is connected.
Initialize (EventNameAsString)
InputStreamAsInputStream [read only]
Gets the network input stream. In most cases the stream should be passed to an AsyncStreams object.
IsInitializedAsBoolean
OutputStreamAsOutputStream [read only]
Gets the network output stream. In most cases the stream should be passed to an AsyncStreams object.
TimeoutAsInt
Gets or sets the socket timeout, measured in milliseconds. By default there is no timeout.
Initializes the socket and starts listening for packets. EventName - Sets the sub that will handle the PacketArrived event. Port - Local port to listen on. Pass 0 to let the OS choose an available port. ReceiveBufferSize - The maximum size of received packets. Pass 0 if the socket should not listen to incoming packets.