Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multicast port is now configurable. #229

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Multicast port is now configurable. #229

wants to merge 1 commit into from

Conversation

JasonMahdjoub
Copy link

I use Cling in order to detect the local UPNP router of the lan, and to ask it to open a port with the current computer. I have made some tests, and they work under Linux and under Windows. However, I can't do these tests under MacOS. Here the log of Cling :

org.fourthline.cling.UpnpServiceImpl INFOS : >>> Starting UPnP service...
org.fourthline.cling.UpnpServiceImpl INFOS : Using configuration: com.distrimind.madkit.kernel.network.DefaultUpnpServiceConfiguration
org.fourthline.cling.transport.Router INFOS : Creating Router: org.fourthline.cling.transport.RouterImpl
org.fourthline.cling.transport.spi.MulticastReceiver INFOS : Creating wildcard socket (for receiving multicast datagrams) on port: 1900
org.fourthline.cling.transport.Router GRAVE : Unable to initialize network router: org.fourthline.cling.transport.spi.InitializationException: Could not initialize MulticastReceiverImpl: java.net.BindException: Address already in use
org.fourthline.cling.transport.Router GRAVE : Cause: org.fourthline.cling.transport.spi.InitializationException: Could not initialize MulticastReceiverImpl: java.net.BindException: Address already in use
org.fourthline.cling.UpnpServiceImpl INFOS : <<< UPnP service started successfully

It appears that the port 1900 is officially used by "Back to my mac" on mac OS. But if I make a netstat ou a lsof, no port is opened.

I have read the code, but there is no possibility to change the multicast port. So I have changed the code to enable it. It does not produce regression and it enables me to open another port than 1900. Then, with these modifications, I can open a port with my UPNP router.

So I propose you to accept this pull request.

Best regards,

Jason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant