Sockets
Write
write textual data to a socket connection
Calling Sequence
Parameters
Description
Examples
Write(sid, text)
sid
-
valid open socket ID
text
string; textual data to write to the socket
The procedure Write is used to write textual data, in the form of Maple strings, to a socket connection.
The argument sid is a valid socket ID for an open socket connection. The argument text is the data (in the form of a Maple string) that is written to the socket connection.
Write attempts to write all the data in the text argument to the socket indicated by sid. If the write operation is successful, the value true is returned. Otherwise, Write returns the value false.
Note: The text data cannot contain null bytes. You can write binary data to a socket connection by using the procedure Sockets[WriteBinary].
with⁡Sockets:
sid≔Open⁡localhost,echo
0
Write⁡sid,Some data to send to the echo server
36
Read⁡sid
Some data to send to the echo server
Close⁡sid
true
See Also
socket definition
Sockets[Read]
Sockets[WriteBinary]
Download Help Document