Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
I have been using Firebase C++ SDK's Auth and Realtime Database (for Windows) in a simple test application. After a succesful authentication every new message (node) is being arrived from the cloud within just a few millisecs until the following happens:
I leave my computer untouched in idle state.
Due to the energy settings it goes to sleep after 10-15 minutes. (don't want to change the settings!)
After I wake it up again the network connection is re-established for all other background applications (like Skype, Outlook etc)
It seems Firebase's connection is NOT re-established.
Is there any built-in function to get notification from Firebase when it's lost the connection and try to re-login, re-connect to the database either automatically or manually?
I guess it has a background keep-alive connection to check network status but I couldn't get any useful information about it. The documentation says it can keep everything synced even in offline mode.
any built-in function to get notification from Firebase when it's lost the connection[?]
For that you'd attach a listener to the virtual .info/connected node, as shown here: https://firebase.google.com/docs/database/android/offline-capabilities#section-connection-state. Somehow this section is missing from the C++ documentation, which is why I linked you to the Android version.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I am trying google cloud compute server, everything is working fine like I am able to connect using open in browser window , But when I am trying to connect using putty , its not working , i am following below docs,
https://cloud.google.com/compute/docs/instances/connecting-to-instance#putty
I also added public key into vm instance but no luck , when I am trying to connect using putty always getting below error:
Disconnected : no supported authentication method available (server sent :publickey,gssapi-keygen,gssapi-with-mic)
on server /var/log/secure
below error there,
error: Received disconnect from 223.165.28.230: 14: No supported authenti
cation methods available [preauth]
don't knew why this is not connecting .any one have any clue, please reply.
As I am new in Google cloud server so it takes sometime to undestand its authentication model,obvious borwser based ssh is good for new user but when we are handling large number of server better to go with key based (putty) method,because it is already used to and sometime we need to transfer file from our local workstation so that time key based auth is best.
finally I understnad the auth/key management of google cloud, yes below google docs are good for understand .
https://cloud.google.com/compute/docs/instances/connecting-to-instance
and for generating key ,
gist.github.com/feczo/7282a6e00181fde4281b
Above link is very very good for creating new instance/single node key management, so please read this docs first.
Note : please use cluster wise key for better management of users and servers authentication process, add key details in metadata -- sshkey , add your key to get access on all vm, yes sometime we need node wise so follow gist.github.com/feczo/7282a6e00181fde4281b ,to enable only one user for this node disable project -wise key under vm edit ssh key options .
Please read both docs before creating google cloud VM server.
Thanks Jarmod for your reply and make me understand the process
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I'm interested in how I might send requests from a web server using Python to a constantly running C++ program. Basically users should be able to send "orders" via their browser to the web server. The web server then needs to forward those orders to a constantly running application written in C++. Eventually the C++ program should be able to send order results back to the web server who can forward the results to the user's browser if they're still connected.
I've thought about having the web server record pending orders to a database which the C++ program polls for changes. That doesn't seem very efficient though. I believe it will have issues with to many users. Is there some method/technology that is typically used for this type of situation?
You have a few options;
1. API
This is more the traditional option, you have some form of API built into your website, and your C++ program contacts the API to receive and update orders. You would probably want to use this if your C++ program isn't hosted on the same server. However you will need to ensure you keep the API secure from outside parties accessing it to fake orders etc.
2. Shared file or database
If your application is running on the same server you could have both programs access a database or flat-file.
3. Sockets (TCP)
This method is likely overkill, you have your C++ program act as TCP server and your python program connects to it and sends it the orders as they come in. You should be aware that programming this option would be significantly harder to the previous options, however it provides an instant response that the others don't.
Easy to implement BaseHttpServer on python, use pipe to communicate with c++ process and proxy_pass clients`s requests via web server.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
i want to create two programs in Qt with one server and another client, my server programs insert user and customer information like fingerptint and another important data and in client users and customers use their information for working on some privacy stuff, these programs must send information on network.
so i think using Postgresql for database on server and client just connect to database and get needed information as login and etc.
and now this is my problems
my network connection must be secure no one can extract data send to
client? (so i think postgres handle this for me, am i right?)
i want to client has offline mode, so i don't mind if i must setup
another Postgresql database on client PC, and then how i can tell
postgres update himself from server or vice versa?
finally whats the best solution you think?
thanks a lot
Wow, that's a bit open-ended. See https://stackoverflow.com/faq#dontask . Keep your questions specific and focused. Open ended I-could-write-a-book-on-this questions will get closed.
Quick version:
my network connection must be secure no one can extract data send to client? (so i think postgres handle this for me, am i right?)
Correctly used SSL will give you one-way trust, where the client can verify the identity of the server. The server must still rely on passwords to identify the client, but it can do that over SSL.
You can use client certificates for true two-way verification.
If you're doing anything privacy sensitive consider using your own self-signed CA and distributing the CA cert through known-secure means. There are too many suborned sub-CAs signing wildcard certificates for nations to use in transparent SSL decryption for me to trust SSL CAs for things like protecting dissidents and human rights workers when they're using an Internet connection supplied or controlled by someone hostile to them.
Don't take my word on this; read up on it carefully.
i want to client has offline mode, so i don't mind if i must setup another Postgresql database on client PC, and then how i can tell postgres update himself from server or vice versa?
It sounds like you want asynchronous replication with intermittent connections.
This is hard. I recommend doing it at the application level where you can implement application-specific sync schedules and conflict resolution logic. You can use trigger maintained change-list tables to keep a record of what changed since the DBs last saw each other. Don't use timestamps to keep in sync, as they clock drift between server and client will cause you to miss changes. You might want to use something like the pgq ticker on the master DB.
finally whats the best solution you think?
Too open ended, not enough info provided to even start to answer.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
This application sends data periodically to a server. What I need to do is setup a testing environment on the local developing machine so that I can check the correct packets are being sent in each situation. I thought a good approach would be a server VM set up on the local computer which would receive the packets and respond just like the real thing, but the problem is how do I route the packets of an application running on windows to a VM machine. I don't want to modify my application code. I just want to have windows pass on the packets it receives from the application to the VM or otherwise another application that will do the testing. Is this possible? If not, please let me know about any other solution(s) to this problem.
If you're running a decent VM you should be able to give it an IP address visible from the host, and configure it so that you can run web servers on it, ssh to it, etc.
Look at the networking features of your VM. Or find a tutorial on how to do this, such as this one for VirtualBox:
http://www.tolaris.com/2009/03/05/using-host-networking-and-nat-with-virtualbox/
Well it's some kind of a hack but you can use ARP Poisoning (man in the middle attack) to sniff packets. There is a tool named Cain & Abel which can do this for you. I've used this tool to sniff packets between two non-pc machines. Use at your own risk and if your anti-virus tool alerts, know that the tool has no virus but what it does is detected as one.
Edit: Please note that my approach doesn't require a VM server.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Hey Guys I am working on Gateway Simulator.
here gateway simulator is connected with the camera.gateway respond when user sends command.
command can be like streaming video or status of the sensor associated battery information etc.There is data center also which will forward the user request to gateway.
There some information which gateway also send to the user or data center with out any request from the user or data center.like battery status down,sensor remove etc etc.
Since this simulator will be used by the developer/QA team to simulate the gateway.they want it it to run in auto pilot mode/pre-scripted instructions mode as well.
I wanted some input from you guys o this.I wanted to know some the widely used approach to address this issue.
any link/suggestion would be fine.This gateway simulator needs to be written ic++ for both linux and windows paltform.
It depends on how (network, console, GUI, ...) the user is sending commands. If it's network or console, writing a script that will feed the command should not be too hard in any language, but there is a tool called expect, built on top of tcl, that's specifically designed for this task. Alternatively if you know perl or python and don't want to learn tcl, you can use the perl Expect module or python pexpect package (windows version).
If the commands are given through a GUI, there is some tooling to automate even that in LDTP. It should work with Gtk+ GUI and I am not sure how far it is with Qt (or whether KDE has something similar).