質問編集履歴
5
文章修正しました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,7 +1,19 @@
|
|
1
1
|
SwiftのNetwork.Frameworkで質問です。
|
2
2
|
設定済みの接続先を変更するにはどうするべきですか?
|
3
3
|
|
4
|
+
```
|
4
|
-
|
5
|
+
connection = NWConnection(host: "127.0.0.1", port: 9600, using: .tcp)
|
6
|
+
|
7
|
+
connection.stateUpdateHandler = { state in
|
8
|
+
switch state {
|
9
|
+
case .ready:
|
10
|
+
print("接続しました")
|
11
|
+
default:
|
12
|
+
print("切断しました")
|
13
|
+
}
|
14
|
+
}
|
15
|
+
let queue = DispatchQueue(label: "label")
|
5
|
-
connection.start(
|
16
|
+
connection.start(queue: queue)
|
17
|
+
```
|
6
18
|
|
7
|
-
|
19
|
+
この様にIPアドレスとポートNOでconnection生成するのですけど、設定画面でIPアドレスとポート番号を設定変更する方法を探してます。
|
4
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
3
title
CHANGED
File without changes
|
body
CHANGED
@@ -2,4 +2,6 @@
|
|
2
2
|
設定済みの接続先を変更するにはどうするべきですか?
|
3
3
|
|
4
4
|
let connection = NWConnection(host: port: using:)
|
5
|
-
connection.start(label:)
|
5
|
+
connection.start(label:)
|
6
|
+
|
7
|
+
接続済みのconnectionを一旦切断して、host変更して再接続する手順を教えてください。
|
2
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
SwiftのNetwork.Frameworkで質問です。
|
2
2
|
設定済みの接続先を変更するにはどうするべきですか?
|
3
3
|
|
4
|
-
let connection = NWConnection(host: port:
|
4
|
+
let connection = NWConnection(host: port: using:)
|
5
|
+
connection.start(label:)
|
1
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,2 +1,4 @@
|
|
1
1
|
SwiftのNetwork.Frameworkで質問です。
|
2
|
-
設定済みの接続先を変更するにはどうするべきですか?
|
2
|
+
設定済みの接続先を変更するにはどうするべきですか?
|
3
|
+
|
4
|
+
let connection = NWConnection(host: port:
|