# socketSend

## Description

Sends data to a socket.

## Input / Parameter

| Name  | Description                     | Input Type  | Default | Options | Required |
| ----- | ------------------------------- | ----------- | ------- | ------- | -------- |
| type  | The type of connection.         | String/Text | -       | -       | Yes      |
| name  | The name of the connection.     | String/Text | default | -       | No       |
| event | The event to listen for.        | String/Text | -       | -       | No       |
| data  | The data to send to the socket. | String/Text | -       | -       | No       |

## Output

N/A

## Callback

### callback

The function to be executed if data is sent to the socket successfully.

### errorCallback

The function to be executed if data is not sent to the socket successfully.

## Video

Coming Soon.

## Example

### Steps

1. First ensure that you have established a socket connection. See `socketConnect`.

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-e29e2efa2f9dfd4b356603099c133827f8e1f414%2FsocketSend-step-1.png?alt=media)
2. Enter the details of data to be sent

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-4efd0fc2a4ce7b0ecbba8abf095ad9a74bdc9a2c%2FsocketSend-step-2.png?alt=media)

### Result

You can specify a function to be called when successful, and another one to be called if it is unsuccessful. See `Callback`.

## Links
