Socket.SetSendBufferSize
------------------------

Sets send buffer size.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Socket](component_Socket.md) | [11.1](newinversion111.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "Socket.SetSendBufferSize"; SocketID; Size ) 

**MBS**( **"Socket.SetSendBufferSize";** /\* Sets send buffer size. \*/  
**$SocketID**; /\* The socket ID received by [Socket.Connect](SocketConnect.md) function.e.g. $sock \*/   
**$Size**) /\* The new buffer size to use.e.g. 256 \* 1024 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| SocketID | The socket ID received by [Socket.Connect](SocketConnect.md) function. | $sock |
| Size | The new buffer size to use. | 256 \* 1024 |

### Result

Returns OK or error.

### Description

Sets send buffer size.  
You may not need to change this ever.  
If you send more data, the function may wait till enough data is sent, so it fits in the buffer. Or OS may automatically resize the buffer.  
### Examples

Test send buffer size:

 Set Variable \[ $sock ; Value: MBS ("[Socket.NewTCPSocket](SocketNewTCPSocket.md)") \]   
\#   
Set Variable \[ $defaultValue ; Value: MBS ("[Socket.GetSendBufferSize](SocketGetSendBufferSize.md)"; $sock ) \]   
Set Variable \[ $v ; Value: MBS ("Socket.SetSendBufferSize"; $sock ; 1024 \* 256) \]   
Set Variable \[ $newValue ; Value: MBS ("[Socket.GetSendBufferSize](SocketGetSendBufferSize.md)"; $sock ) \]   
Show Custom Dialog \[ "Default: " &amp; $defaultValue &amp; ¶ &amp; "Set to: " &amp; $newValue \]   
\#   
Set Variable \[ $r ; Value: MBS ("[Socket.Close](SocketClose.md)"; $sock ) \]  
### See also

- [Socket.Close](SocketClose.md)
- [Socket.Connect](SocketConnect.md)
- [Socket.GetReceiveBufferSize](SocketGetReceiveBufferSize.md)
- [Socket.GetSendBufferSize](SocketGetSendBufferSize.md)
- [Socket.NewTCPSocket](SocketNewTCPSocket.md)
- [Socket.SetReceiveBufferSize](SocketSetReceiveBufferSize.md)

### Release notes

- **Version 11.1**
    - Added new [socket](https://www.mbsplugins.eu/component_Socket.shtml) functions to set send/receive buffer size: [Socket.GetReceiveBufferSize](https://www.mbsplugins.eu/SocketGetReceiveBufferSize.shtml), [Socket.GetSendBufferSize](https://www.mbsplugins.eu/SocketGetSendBufferSize.shtml), [Socket.SetReceiveBufferSize](https://www.mbsplugins.eu/SocketSetReceiveBufferSize.shtml), [Socket.SetSendBufferSize](https://www.mbsplugins.eu/SocketSetSendBufferSize.shtml).

### Blog Entries

- [MBS FileMaker Plugin, version 11.1pr1](https://www.mbsplugins.de/archive/2021-02-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 19th January 2021 , last changed 19th January 2021

  
[Socket.SetReceiveBufferSize](SocketSetReceiveBufferSize.md) - [Socket.SetTag](SocketSetTag.md)

[HTML Version](SocketSetSendBufferSize.shtml)