Cannot broadcast messages
0x0c opened this issue · 8 comments
Hello, I use SwiftOSC to broadcast messages, but I cannot receive my computer.
The computer and my iPhone connects same wifi.
Sending messages to specific ip address is works.
Is there any workaround?
The computer and the iPhone joined same network.
Its network address is 192.168.1.0
, and my app runs on the iPhone send messages to 192.168.1.255
as known as broadcast address.
I think my computer receive messages, however no messages received.
Instead of broadcasting, send specific address like 192.168.1.100
which is the computer's address, it works.
I found public func enableBroadcast()
in UDPClient and I edit var client: UDPClient
to public
in OSCClient.swift
at line 16.
Then, call func enableBroadcast()
before call public func send(_ element: OSCElement)
in OSCClient
, it works.
Sorry for my broken English :(
Regards
Yes, currently it works, but need to edit SwiftOSC, so it is not convenient when using cocoa pods.
Is it possible to merge my code when I send pull request?
Yes, my workaround is that made the UDPClient public.
I think this change is not good for broadcast messages, because it needs to call client.client.enableBroadcast()
before send a message.
I'll edit another way to make more convenient, after that I'll send pull request.