tag:blogger.com,1999:blog-5196103582241137578.post8875586764303774999..comments2024-03-08T10:52:16.816+01:00Comments on eneter.net: Android: How to Receive Notification Messages from Multiple .NET Applications via WebsocketsOndrejhttp://www.blogger.com/profile/11029096061173289386noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-5196103582241137578.post-72980160064462814052018-06-02T22:42:46.650+02:002018-06-02T22:42:46.650+02:00Hi, I have always loved eneter. I use Xamarin andr...Hi, I have always loved eneter. I use Xamarin android. How do I implement this with Xamarin android. Any samples?Anonymoushttps://www.blogger.com/profile/02147488274016732231noreply@blogger.comtag:blogger.com,1999:blog-5196103582241137578.post-63426000334601862812016-09-19T09:14:09.873+02:002016-09-19T09:14:09.873+02:00I found the reason for Android not connecting issu...I found the reason for Android not connecting issue.<br />Make sure following points before trying example code.<br /><br />1) The IP address in broker should be the real IP of network interface if you want to try it on your network. e.g. if you enter 127.0.0.1 IP it doesn't work on network, because Windows binds to specific IP address.<br /><br />2) After Android Gingerbread (API level 10), it doesn't allow to open communication channel on main thread.<br /><br />http://stackoverflow.com/questions/6343166/how-to-fix-android-os-networkonmainthreadexceptionAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-5196103582241137578.post-54477146194242624242016-09-09T17:14:45.503+02:002016-09-09T17:14:45.503+02:00Hi Ondrej,
It's great framework, many other An...Hi Ondrej,<br />It's great framework, many other Android examples work for me.<br /><br />But this one, .net Publisher connects successfully to Broker but Android client doesn't connect at all, it keep showing Disconnected. On tapping Reconnect button it doesn't connect neither any error.<br /><br />I'm running on Android physical device, I tried changing port to 80 in all three modules, Broker, Publisher, Subscriber.<br /><br />In Android Monitor window it shows following 2 lines on tapping Reconnect.<br /><br />09-09 16:32:31.871 14721-14721/eneter.android D/ViewRootImpl: ViewPostImeInputStage processPointer 0<br />09-09 16:32:32.041 14721-14721/eneter.android D/ViewRootImpl: ViewPostImeInputStage processPointer 1<br /><br />I'm relatively new to Android, please help.Microsofteehttps://www.blogger.com/profile/01347167385968491051noreply@blogger.comtag:blogger.com,1999:blog-5196103582241137578.post-50656116318596350872016-05-02T14:35:01.091+02:002016-05-02T14:35:01.091+02:00Hello, you provided only little information. So it...Hello, you provided only little information. So it is difficult to understand what is the problem.<br />If you like you can send me details via my email.Ondrejhttps://www.blogger.com/profile/11029096061173289386noreply@blogger.comtag:blogger.com,1999:blog-5196103582241137578.post-10456061257722076922016-04-28T00:11:04.381+02:002016-04-28T00:11:04.381+02:00Hello Ondrej, thank you for the library and of cou...Hello Ondrej, thank you for the library and of course this example. I need to send response message from android part (subscribert) to sender (publisher). I have tried events but nothing worked out yet. Can you help me?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5196103582241137578.post-38368053668213854592016-02-07T16:34:09.004+01:002016-02-07T16:34:09.004+01:00Hello, I am glad you like the framework.
WebSocket...Hello, I am glad you like the framework.<br />WebSockets should work too. What is the exception (including callstack) you get?<br />Could you please doublecheck you have correctly setup WebSocketMessagingSystemFactory and addrresses on both client and service?Ondrejhttps://www.blogger.com/profile/11029096061173289386noreply@blogger.comtag:blogger.com,1999:blog-5196103582241137578.post-14874399347116577912016-02-07T11:06:21.655+01:002016-02-07T11:06:21.655+01:00thank you for this great library. I tested the co...thank you for this great library. I tested the codes on "How to communicate with .NET application via TCP" it work perfectly.<br />In this topic (Websockets). The .Net side work fine but when I try to run the android client i get exception within lines.<br /><br /> // Attach the output channel and be able to communicate with broker.<br /> myBrokerClient.attachDuplexOutputChannel(myOutputChannel);<br /><br /><br />I use android studio uptodateAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-5196103582241137578.post-83675064827541124422015-04-04T08:47:50.822+02:002015-04-04T08:47:50.822+02:00To your points:
1. Combined Example
Depending on ...To your points:<br /><br />1. Combined Example<br />Depending on your exact needs there are several possibilities how you can do it.<br />If you need just a simple push from the service to the client then the easiest way is to establish a communication between DuplexTypeMessageSender (on client site) and DuplexTypedMessageReceiver (service side). And then your service can call DuplexTypedMessageReceiver.SendResponseMessage(..) any time it needs. It means your service can send messages to the client without previous request message.<br />If this solution is not sufficient then you can use DuplexBroker and DuplexTypedMessageSender-DuplexTypedMessageReceiver side by side. DuplexTypedMessages for request-response scenarios and DuplexBroker for publish-subscribe scenario. The easiest way how to do it is to make listening them on different addresses. It means e.g. in case of TCP they can be on different ports e.g. the DuplexTypedMessageReceiver can listen to tcp://127.0.0.1:8091/ and DuplexBroker can listen to tcp://127.0.0.1:8092/. In case of WebSockets you can have addresses like ws://127.0.0.1:8090/MessageReceier/ and ws://127.0.0.1:8090/Broker/.<br /><br />2. Reconnect Logic<br />In general it is possible but there is one thing which is not visible on the first look. It is that the broker is NOT stateless. The broker maintains subscriptions for each connected client. If the client disconnects the broker cleans the subscription list for that client (in order to avoid memory leaks). Therefore if you use the reconnect it may happen that when the connection is broken the broker cleans the subscriptions for the disconnected client. Meanwhile the client works offline (it means the BrokerClient does not there is a disconnection) and tries to reconnect. When it reconnects the subscription list is not there anymore and so the client will not get any messages.<br />The solution is that the service side (broker) must have set longer offline time than the client (broker). If the service has the equal or less offline time then the subscription list could get cleaned.<br />E.g. on the client side:<br />aMessaging = new BufferedMessagingSystemFactory(anUnderlyingMessaging, 60000);<br />service side:<br />aMessaging = new BufferedMessagingSystemFactory(anUnderlyingMessaging, Timespan.FromMilliseconds(90000));<br />Ondrejhttps://www.blogger.com/profile/11029096061173289386noreply@blogger.comtag:blogger.com,1999:blog-5196103582241137578.post-64967175090098535912015-04-02T22:33:59.325+02:002015-04-02T22:33:59.325+02:00This comment has been removed by the author.toddmohttps://www.blogger.com/profile/18102486213069100450noreply@blogger.com