Socket.SetReceiveBufferSize
---------------------------

Sets receive 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.SetReceiveBufferSize"; SocketID; Size ) 

**MBS**( **"Socket.SetReceiveBufferSize";** /\* Sets receive 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 receive buffer size.  
You may not need to change this ever.  
If you don't read fast enough, data flow will go slower to have the buffer work.  
### Examples

Test setting buffer size value:

 Set Variable \[ $sock ; Value: MBS ("[Socket.NewTCPSocket](SocketNewTCPSocket.md)") \]   
\#   
Set Variable \[ $defaultValue ; Value: MBS ("[Socket.GetReceiveBufferSize](SocketGetReceiveBufferSize.md)"; $sock ) \]   
Set Variable \[ $v ; Value: MBS ("Socket.SetReceiveBufferSize"; $sock ; 1024 \* 256) \]   
Set Variable \[ $newValue ; Value: MBS ("[Socket.GetReceiveBufferSize](SocketGetReceiveBufferSize.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.SetSendBufferSize](SocketSetSendBufferSize.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.SetNewConnectionURL](SocketSetNewConnectionURL.md) - [Socket.SetSendBufferSize](SocketSetSendBufferSize.md)

[HTML Version](SocketSetReceiveBufferSize.shtml)