---
title: init()
framework: foundation
role: symbol
role_heading: Initializer
path: foundation/socketport/init()
---

# init()

Initializes the receiver as a local TCP/IP socket of type SOCK_STREAM.

## Declaration

```swift
convenience init()
```

## Return Value

Return Value An initialized local TCP/IP socket port of type SOCK_STREAM.

## Discussion

Discussion The port number is selected by the system.

## See Also

### Related Documentation

- [Distributed Objects Programming Topics](apple-archive/documentation/Cocoa/Conceptual/DistrObjects.md)

### Creating Instances

- [init(tcpPort:)](foundation/socketport/init(tcpport:)-6hgbo.md)
- [init(protocolFamily:socketType:protocol:address:)](foundation/socketport/init(protocolfamily:sockettype:protocol:address:).md)
- [init(protocolFamily:socketType:protocol:socket:)](foundation/socketport/init(protocolfamily:sockettype:protocol:socket:).md)
- [init(remoteWithTCPPort:host:)](foundation/socketport/init(remotewithtcpport:host:).md)
- [init(remoteWithProtocolFamily:socketType:protocol:address:)](foundation/socketport/init(remotewithprotocolfamily:sockettype:protocol:address:).md)
