> For the complete documentation index, see [llms.txt](https://trialkey.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trialkey.gitbook.io/docs/api-reference/methods/senddata.md).

# SendData

## Description

Sends data to a remote host.

{% hint style="info" %}
**Good to know:** This is the one and only method for sending data whether you are writing a server or a client.
{% endhint %}

## Remarks

Use the SocketHandle parameter to specify which socket data is to be sent through. Data can be sent as a string, or as raw data (such as a file or image), in which case it should be passed as a byte array. Note that the RemoteHostUDP and RemotePortUDP parameters are not currently supported and are included only for future extensibility.

## Prototype

LONG CSockQ::AddListener(long PortToListenOn, INT Protocol, long AdapterNumber, long Backlog)
