socket.write
Syntax
- v = socket.write(a,i1,s)
Write FISH variables through a socket. The FISH variables are stored in the specified FISH array. Currently, only parameters of type Boolean, Integer, Real, String, or Vector can be sent or received via sockets.
Note
For connections to sockets created in a language other than FISH, parameters are encoded as described below. First a 32 bit integer is sent indicating the parameter type. The size and encoding that comes next is dependent on the parameter, as described in the table below. All values are little-endien.
Code
Type
Encoding
Integer
32 bit (4 byte) signed integer.
Real
64 bit (8 byte) double precision floating point value.
String
32 bit integer indicating how many bytes are following. This will always be in increments of 4. The string data is not necessarily null terminated.
2D Vector
Two 64 bit (8 byte) double precision floating point values.
3D Vector
Three 64 bit (8 byte) double precision floating point values.
Integer
64 bit (8 byte) signed integer.
Boolean
8 bit signed integer. Zero means false. Non-zero means true.
Was this helpful? ... | Itasca Software © 2024, Itasca | Updated: Dec 19, 2024 |