Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 12.2   12.3   12.4   12.5   13.0   13.1   13.2   13.3   13.4   13.5    Statistic    FMM    Blog  

Socket.WriteByte

Writes a single byte to the socket.

Component Version macOS Windows Linux Server iOS SDK
Socket 3.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "Socket.WriteByte"; SocketID; Value )   More

Parameters

Parameter Description Example
SocketID The socket ID received by Socket.Connect function. $sock
Value The byte value. Range from 0 to 255. 13

Result

Returns OK or error message.

Description

Writes a single byte to the socket.
This is useful if you need to send single control bytes like message start or message end.

Result is -1 if socket can't write. See Socket.LastError for error code.
Changed in v10.4 to return error if socket is closed or disconnected instead of -1.

See also

Blog Entries

This function checks for a license.

Created 18th August 2014, last changed 31st August 2020


Socket.Write - Socket.WriteHex

💬 Ask a question or report a problem