---
title: writeClose()
framework: networkextension
role: symbol
role_heading: Instance Method
path: networkextension/nwtcpconnection/writeclose()
---

# writeClose()

Close the connection for writing.

## Declaration

```swift
func writeClose()
```

## Discussion

Discussion Close this connection’s write side such that further write requests won’t succeed. Note that this has the effect of closing the read side of the peer connection. When the connection’s read side and write side are closed, the connection is considered disconnected and will transition to the appropriate state.

## See Also

### Transferring data

- [readMinimumLength(_:maximumLength:completionHandler:)](networkextension/nwtcpconnection/readminimumlength(_:maximumlength:completionhandler:).md)
- [readLength(_:completionHandler:)](networkextension/nwtcpconnection/readlength(_:completionhandler:).md)
- [write(_:completionHandler:)](networkextension/nwtcpconnection/write(_:completionhandler:).md)
