---
title: socket
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/socketport/socket
---

# socket

The receiver’s native socket identifier on the platform.

## Declaration

```swift
var socket: SocketNativeHandle { get }
```

## Discussion

Discussion In macOS, the native socket identifier is an integer file descriptor.

## See Also

### Getting Information

- [address](foundation/socketport/address.md)
- [protocol](foundation/socketport/protocol.md)
- [protocolFamily](foundation/socketport/protocolfamily.md)
- [socketType](foundation/socketport/sockettype.md)
