- This topic has 3 replies, 3 voices, and was last updated 10 years, 8 months ago by Anonymous.
-
AuthorPosts
-
March 21, 2014 at 00:43 #2384AnonymousInactive
Hi, I’m trying to use the new PeerDiscovery Feature. On Windows and Windows Phone it works, but on Android just get an Exception. Permissions in AndroidManifest should be sufficient, and I can create and use TCP and UDP Connections. I guess it’s a problem with the broadcast address used for PeerDiscovery. Tried it on 3 devices.
InnerException = {System.Net.Sockets.SocketException}
Message = “Access denied”Subsequent an extract of the stacktrace:
at NetworkCommsDotNet.Connections.UDP.UDPConnection.SendObject[Byte[]] (IPacket packetToSend, System.Net.IPEndPoint ipEndPoint, NetworkCommsDotNet.SendReceiveOptions sendReceiveOptions, ApplicationLayerProtocolStatus applicationLayerProtocol) [0x000af] in c:\Users\Karnifexx\Documents\Visual Studio 2010\Projects\networkcomms.net\NetworkCommsDotNet\Connection\UDP\UDPConnectionStatic.cs:319 at NetworkCommsDotNet.Tools.PeerDiscovery.DiscoverPeersUDP (Int32 discoverTimeMS) [0x00031] in c:\Users\Karnifexx\Documents\Visual Studio 2010\Projects\networkcomms.net\NetworkCommsDotNet\Tools\PeerDiscovery.cs:629 at NetworkCommsDotNet.Tools.PeerDiscovery.DiscoverPeers (DiscoveryMethod discoveryMethod, Int32 discoverTimeMS) [0x0004e] in c:\Users\Karnifexx\Documents\Visual Studio 2010\Projects\networkcomms.net\NetworkCommsDotNet\Tools\PeerDiscovery.cs:578 at NetworkCommsDotNet.Tools.PeerDiscovery.DiscoverPeers (DiscoveryMethod discoveryMethod) [0x00000] in c:\Users\Karnifexx\Documents\Visual Studio 2010\Projects\networkcomms.net\NetworkCommsDotNet\Tools\PeerDiscovery.cs:554 Attempting to determine the best local endPoint to connect to 255.255.255.255:39215 resulted in a socket exception.
March 21, 2014 at 10:46 #2386AnonymousInactiveHi Ekki,
First of all thank you for using NetworkComms.Net! I’ve had a look at this and I think I’ve found the source of the bug, I just need to do some more testing at my end to confirm. I’ll send you an updated version to try once I’m confident we’ve solved the issue.
Best regards,
Matt
March 26, 2014 at 23:21 #2412AnonymousInactiveHi Matt,
thank you very much for your fix, now discovery works on Android, too.
But it seems to have the side effect that it’s no more possible to start listening like this:
Connection.StartListening(ConnectionType.TCP, new IPEndPoint(IPAddress.Any, 39113));That raises the Exception: System.Net.Sockets.SocketException: Address already in use
or after it is handled by NetworkComms
{networkcomms.netmsSetupShutdownException: It was not possible to open port #39113 on 0.0.0.0. This endPoint may not support listening or possibly try again using a different port. at NetworkCommsDotNet.Connections.TCP.TCPConnectionListener.StartListening (System.Net.EndPoint desiredLocalListenEndPoint, Boolean useRandomPortFailOver) [0x00147] in c:\Users\Karnifexx\Documents\Visual Studio 2010\Projects\networkcomms.net\NetworkCommsDotNet\Connection\TCP\TCPConnectionListener.cs:132 at NetworkCommsDotNet.Connections.Connection.StartListening[IPEndPoint] (NetworkCommsDotNet.Connections.ConnectionListenerBase listener, System.Net.IPEndPoint desiredLocalEndPoint, Boolean useRandomPortFailOver) [0x000bb] in c:\Users\Karnifexx\Documents\Visual Studio 2010\Projects\networkcomms.net\NetworkCommsDotNet\Connection\ConnectionListeners.cs:182 at NetworkCommsDotNet.Connections.Connection.StartListening[IPEndPoint] (ConnectionType connectionType, System.Net.IPEndPoint desiredLocalEndPoint, Boolean allowDiscoverable) [0x0010c] in c:\Users\Karnifexx\Documents\Visual Studio 2010\Projects\networkcomms.net\NetworkCommsDotNet\Connection\ConnectionListeners.cs:88 }
If PeerDiscovery is enabled or not doesn’t matter and just on Android.
March 27, 2014 at 12:34 #2415AnonymousInactiveHeya Ekki,
Looks like a fix a recent fix for iOS broke Android, not uncommon. We’ll make the fix and email you an update.
Regards,
Marc -
AuthorPosts
- You must be logged in to reply to this topic.