write binary data on a socket connection
socket ID for the socket connection
rtable with hardware datatype
The procedure Sockets[Write] cannot be used to write binary data on a socket connection because Maple strings cannot encode the data. Therefore, the interface WriteBinary is provided to enable you to send binary data onto a socket connection.
The first argument is a valid and open socket ID sid on which the data is written. The second argument is an rtable a with a hardware datatype that contains the data you want to write to the socket connection.
The rtable a cannot use indexing functions and it must have rectangular storage. The rtable can have any of the following hardware datatypes:
integer[ 1 ]
integer[ 2 ]
integer[ 4 ]
integer[ 8 ]
float[ 4 ]
float[ 8 ]
If the datatype of a is anything but integer, then the data is treated as structured and each "record" is converted to Network Byte Order before being written to the socket.
The number of bytes actually written to the socket is returned as a Maple (non-negative) integer.
sid ≔ Open⁡mantis,echo
a ≔ Array⁡convert⁡Hello,'bytes','datatype'='integer'1
Download Help Document