I use for my use case the Network.Framework API.
My use case is the following:
With my current code I get no data from the another host (B), it's only possible to receive data from host (A).
Here is my code:
This code works fine for the steps 1-3 from my scenario, but not for the step 4. IMHO the NF-API create a point-to-point connection the remote site.
But I want a point-to-multipoint connection on my local site (receive data from two host or more).
Is this possible?
My use case is the following:
start a UDP connection on a specific port
send UDP data to this host (A)
get maybe data (its's optional) from this host (A)
and receive data (on same port as above) from another host (B) (must-have)
With my current code I get no data from the another host (B), it's only possible to receive data from host (A).
Here is my code:
Code Block let endpoint = NWEndpoint.hostPort(host: NWEndpoint.Host.init("1.2.3.4"), port: NWEndpoint.Port(rawValue: UInt16(35000))!) let params = NWParameters(dtls: nil, udp: .init()) params.requiredLocalEndpoint = NWEndpoint.hostPort(host: .ipv4(.any), port: 40000) connection = NWConnection(to: endpoint, using: params) connection.start(queue: queue) // after the connection is ready (in state update handler) // I start the receive code like this: connection.receiveMessage { (data, _, isComplete, error)
This code works fine for the steps 1-3 from my scenario, but not for the step 4. IMHO the NF-API create a point-to-point connection the remote site.
But I want a point-to-multipoint connection on my local site (receive data from two host or more).
Is this possible?