---
title: "CFSocketIsValid(_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfsocketisvalid(_:)"
---

# CFSocketIsValid(_:)

Returns a Boolean value that indicates whether a CFSocket object is valid and able to send or receive messages.

## Declaration

```swift
func CFSocketIsValid(_ s: CFSocket!) -> Bool
```

## Parameters

- `s`: The CFSocket object to examine.

## Return Value

Return Value true if s can be used for communication, otherwise false.

## See Also

### Using Sockets

- [CFSocketConnectToAddress(_:_:_:)](corefoundation/cfsocketconnecttoaddress(_:_:_:).md)
- [CFSocketCreateRunLoopSource(_:_:_:)](corefoundation/cfsocketcreaterunloopsource(_:_:_:).md)
- [CFSocketGetTypeID()](corefoundation/cfsocketgettypeid().md)
- [CFSocketInvalidate(_:)](corefoundation/cfsocketinvalidate(_:).md)
- [CFSocketSendData(_:_:_:_:)](corefoundation/cfsocketsenddata(_:_:_:_:).md)
