---
title: "init(remoteWithProtocolFamily:socketType:protocol:address:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/socketport/init(remotewithprotocolfamily:sockettype:protocol:address:)"
---

# init(remoteWithProtocolFamily:socketType:protocol:address:)

Initializes the receiver as a remote socket with the provided arguments.

## Declaration

```swift
init(remoteWithProtocolFamily family: Int32, socketType type: Int32, protocol: Int32, address: Data)
```

## Parameters

- `family`: The protocol family for the socket port. Possible values are defined in <sys/socket.h>, such as AF_LOCAL, AF_INET, and AF_INET6.
- `type`: The type of socket.
- `protocol`: The specific protocol to use from the protocol family.
- `address`: The family-specific socket address for the receiver copied into an NSData object.

## Discussion

Discussion A connection is not opened to the remote address until data is sent.

## See Also

### Creating Instances

- [init()](foundation/socketport/init().md)
- [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)
