Write data to a socket.
[in] Reference to the uchar type array with the data to be sent to the socket.
[in] 'buffer' array size.
If successful, return the number of bytes written to a socket. In case of an error, -1 is returned.
If an error occurs on a system socket when executing the function, connection established via SocketConnect is discontinued.
In case of a data writing error, the error 5273 (ERR_NETSOCKET_IO_ERROR) is written to _LastError.
The function can be called only from Expert Advisors and scripts, as they run in their own execution threads. If calling from an indicator, GetLastError() returns the error 4014 – "Function is not allowed for call".