I've been using Red5 0.9.0.1, and im trying to disconnect a flash client app from my red5 server app. I've achived to manually disconnect the client by using close(); on my flash app. but I cant just achieve to disconnect the user when the user closes the windows explorer, or the user looses its internet connection.
any suggestion on how to do this? can someone guide me to the right path?
The red5 server method disconnect does exactly this.
you need to override it and it will look like this...
#Override
public void disconnect(IConnection conn, IScope scope)
{
}
In IE, you must use an onUnLoad() handler to then call into your Flash client app. The call should then close the NetConnection; this is the "cleanest" way to do it. Otherwise on the server side, the I/O library will detect and handle the disconnection (peer disconnect).
Related
this question may seem duplicate, but I've searched a lot, but could not find any appropriate solution.
I need my socket connection to not break when user kills/closes app. It works when user presses the home button and apps goes to background. But connection breaks when user kills or closes the app. I need behavior like how chat apps like whatsapp literally work. So when I close the whatsapp, I can still receive new messages.
If anyone has found any solution for this, please share.
Thank you.
Your Socket connection should run as a background task and continuously listen to stream of message events even when the app close then you can push notifications to notify the user.
https://github.com/jamesisaac/react-native-background-task provide an abstract layer for both iOS and Android
I am trying to send sms through gsm modem using vb.net winform application. But when i try to send sms it throws the error
The process cannot access the port 'COM4' because it is being used by another process.
i tried to check but there is no way i can find which process is using com4.
anyone else ever faced this problem? any solutions regarding this issue?
Regards
You can try this: How do I determine which process is using a serial port?
If that doesn't work, I had that happen before and basically I just renamed the device I was trying to access to another COM port number and then tried again. If it is actively being used by another process then you'll probably get an error from the application that was using it.
I get an error message "an error has occurred while sending a request" when my UWP app tries to communicate with a WCF Service Application (that retrieves info from a database server). This error occurs when the app/service combo runs in Windows Mobile 10 Emulator and phone. On the other hand, this combo of app/service runs fine in Local Machine (my Windows 10 desktop PC). Seem like the WCF service may not be running when the app/service is running in the emulator or the phone. I would like to fix this problem if this is possible. If this is not possible, please suggest an alternative.
What I am trying to accomplish is to use a Windows 10 phone to connect to our database server (SQL Server) (all in local WiFi network, not through internet) to view or to update data in the database. Unfortunately UWP doesn't allow UWP apps to connect to the database server directly as stated in this web page:
https://code.msdn.microsoft.com/How-to-access-data-from-935e360c#content
According to that web page, I need to create a WCF Service Application as a middle-man between the UWP app and the database server. That is the reason why I need a WCF Service Application in addition to my UWP app.
Please note that I have tried the sample program in the web page shown above. Unfortunately, it has the same problem as my app.
As mentioned above, the sample program and my app both work fine in Local Machine (the database is in a database server that is not in the Local Machine). But both show the same error when they are running in Windows emulator or in a Windows phone.
I have tried to narrow this down by using a bare-bone WCF Service Application that doesn't connect to the database server to rule out the database connection has anything to do with this problem. The bare-bone WCF Service Application simply returns hardcoded test data to the UWP app. But it still has the same problem. This means the problem has nothing to do with database connection.
The bare-bone WCF Service Application is created using the WCF Service Application template. I have only renamed the classes (from Service1/IService to DbService/IDbService). Nothing to it.
The error is triggered in the GetDataAsync(...) statement in the example shown below. It is in OnLoaded() event handler of MainPage.xaml.cs of the UWP app:
private async void OnLoaded(object sender, RoutedEventArgs e)
{
try
{
RefDbService.DbServiceClient client1 = new RefDbService.DbServiceClient();
String sTestMsg = await client1.GetDataAsync( 12345 );
// The above statement triggers the error in Emulator or in phone.
this.lblDebugMsg.Text = sTestMsg;
}
catch( Exception ex )
{
this.lblDebugMsg.Text = ex.Message;
}
}
Thanks in advance for any help.
Jay Chan
My last message had a wrong URL (duplicated URL). The following has the corrected one:
I have finally created a small sample program (WCF service and UWP app) that actually works. If someone needs to do the same thing, you need to following this tutorial https://msdn.microsoft.com/en-us/library/ms734712(v=vs.110).aspx to learn how to write a WCF Windows Service Library (needs a host program) that works with console application, and then following this web page https://msdn.microsoft.com/en-us/library/ms733766(v=vs.110).aspx to learn the way to convert it into a WCF Web Service Application running under IIS and work with UWP. Remember to update the service-reference of the app whenever you change the configuration of the WCF service.
I am trying to implement google+ authentication on my MVC5 app but am struggling to get it working on my live environment.
I have generated new keys for me live site from google apis and deployed the code.
I have set anonymous authentication for my site in iis8 on my server.
When I click the Google+ login button for the first time, I get to the sign in page and can click accept. The process then waits and waits until finally it fails. The second time round, I don't get the google login, but again get loads of waiting until it fails.
The code is failing on this line with a SQLException:
var result = await SignInManager.ExternalSignInAsync(loginInfo, isPersistent: false);
"A network related or instance specific error occured while establishing a connection to the SQL server".
Now as far as I can see with that line of code, I am not trying to connect to my SQL environment. So is this connecting to google to validate? Do I need some firewall ports or IP's opened on the server?
In IIS Express on my local, everything works fine!!
Many thanks
It's impossible to give accurate advice based on your description, but i had about same issue after installed new web app template in Visual Studio (thats how i come here). Probably you forget to change computer name in your web-config/connectionStrings or you dont have sql server installed.
I'm using worklight application management features from an Android native App.
I want that when in the console the application status is changed to "Access Disabled" the only option for the user will be to quit.
In the Knowledge Center and in Developer works there is documentation about how to do it:
http://www-01.ibm.com/support/knowledgecenter/SSZH4A_6.2.0/com.ibm.worklight.appadmin.doc/admin/t_denying_access_to_older_app_versions.html?lang=en
https://www.ibm.com/developerworks/community/blogs/worklight/entry/how_to_create_a_customized_remote_disable_behavior?lang=en
It is explained that you must set a specific value for the initOptions object used in the WL.Client.init() method.
But in the Android native API I have not found the way to set the initOptions. The init method is deprecated and it does not accept initOptions.
Also, in case of Remote Disable the ResponseListener used in the WLClient.connect(aResponseListener) is not invoked, success or failure, no method is executed. Is this working as designed? I would expect a failure or success but not nothing.
Is it possible in a native app to force the application to close in case of Remote Disable?
How could I handle this situation manually in the app?
Unfortunately I do not have an example for you, but this is the general idea.
See if you can work with it (if someone can produce an example - please do...):
You need to create your own Remote Disable challenge handler that will extend the default Worklight Remote Disable challenge handler (RemoteDisableChallengeHandler.java).
class MyRemoteDisableChallengeHandler extends WLRemoteDisableChallengeHandler
Then you need to implement your custom logic in MyRemoteDisableChallengeHandler
WLClient.registerChallengeHander(new MyRemoteDisableChallengeHandler())
This will override the original.
You'll need to create your own dialog with a Quit button.
Some additional documentation.
For handling MaM configurations, this is, when you configure the app as Lost, Stolen, etc, in the Worklight Console -> Devices tab you must install the Fix IF201408281937 (Worklight 6.2) or later.
This events are also handled with the ChallengeHandler registered for the realm "wl_remoteDisableRealm"