---
title: maximumMessageSize
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/urlsessionwebsockettask/maximummessagesize
---

# maximumMessageSize

The maximum number of bytes to buffer before the receive call fails with an error.

## Declaration

```swift
var maximumMessageSize: Int { get set }
```

## Discussion

Discussion This value includes the sum of all bytes from continuation frames. Receive calls will fail once the task reaches this limit.

## See Also

### Sending and receiving data

- [send(_:completionHandler:)](foundation/urlsessionwebsockettask/send(_:completionhandler:).md)
- [URLSessionWebSocketTask.Message](foundation/urlsessionwebsockettask/message.md)
- [receive(completionHandler:)](foundation/urlsessionwebsockettask/receive(completionhandler:).md)
