Name
SendData -- send data through the network (V5.0)
Synopsis
count = SendData(id, data$)
Function
This function can be used to send data to a server or a client. If you want to send data to a server, you need to pass an identifier obtained from OpenConnection() to this function. If you are a server and want to send data to one of your clients, you need to pass the identifier of the respective client. You will receive the identifiers of your clients by listening to the OnConnect event handler which you can set up by calling InstallEventHandler().

The second argument is a string containing the data that you want to send to the recipient. Please note that although this argument is a string, it is not limited to text only. You can also send raw data with this function because Hollywood strings can handle character control codes as well as the special NULL character without problems.

Upon return, SendData() will return the number of bytes that it has successfully transmitted to the recipient. This can be less than the number of bytes in data$.

Inputs
id
identifier of the recipient
data$
string containing the data that should be sent
Results
count
number of bytes successfully transmitted
Example
See OpenConnection


Show TOC