connection

Android device needs to be connected to server - C2DM, polling or something third?

我的梦境 提交于 2019-12-09 04:38:27
I'm currently in the process of developing an app which has some very demanding needs. The Project An application which can communicate with a server is needed. Small messages has to be send to the app which could display a notification or start an activity. The Demands Client needs to be sure that the phone is 'connected' at all times. The client expects that the app can tell when it's no longer connected (or able to connect) to the server it tells the user. Client needs to be able to send a message to individual devices If the client needs to broadcast a message to the connected devices and

How do I simulate a slow internet connection (Edge/3g) on a mac. Is there a Firefox plugin?

匆匆过客 提交于 2019-12-09 04:08:46
问题 Exact Duplicate : https://stackoverflow.com/questions/473465/firefox-plugin-to-simulate-slow-internet-connection How do I simulate a slow internet connection (Edge/3g) on a Mac? Is there a Firefox plugin? 回答1: On a Mac or BSD, use: sudo ipfw pipe 1 config bw 350kbit/s plr 0.05 delay 500ms sudo ipfw add pipe 1 dst-port http And to reset to your initial settings: sudo ipfw flush 回答2: Apple now have an official developer tool called Network Link Conditioner which simulates different network

C++ Boost.ASIO: passing accepted TCP connection from one opened socket to another using Windows APIs ( while works with Linux APIs)?

青春壹個敷衍的年華 提交于 2019-12-09 01:21:30
问题 I was trying to learn how to re assign accepted connection using Boost.ASIO and Windows API's. found this code sample added to it includes and use of namespaces so now it is compilable - just copy and paste and here you go... "The parameter is incorrect" exception at the same place code poster had it=( So here is code: #include <iostream> #include <boost/asio.hpp> #ifdef _WIN32 #include "Windows.h" #endif using namespace boost::asio::ip; using namespace std; int main(){ int m_nPort = 12345;

How to ping a website from an Android activity and get response?

流过昼夜 提交于 2019-12-09 01:02:12
问题 I used isReachable, but it didn't work, and I used ConnectivityManager and getNetworkInfo; actually this works only to check if I am connected to the Internet... But the issue is I want to check if I can access the Internet so I want to ping a website to check if there is a response. 回答1: For the get method: private void executeReq(URL urlObject) throws IOException{ HttpURLConnection conn = null; conn = (HttpURLConnection) urlObject.openConnection(); conn.setReadTimeout(100000); /

How do I start an Asynchronous NSURLConnection inside an NSOperation?

痴心易碎 提交于 2019-12-09 00:48:57
问题 I want to do an Asynchrous NSURLConnection inside of an NSOperation on a background thread. it is because I'm doing some very expensive operations on the data as they come back. This is a very similar question to what they asked here: How do I do an Asynchronous NSURLConnection inside an NSOperation? but the difference is that I run the connection in another class. Here is my first attempt: In my MainViewController: @property (nonatomic, strong) NSOperationQueue *requestQueue; #pragma mark -

What are the possible results of PDO::getAttribute(PDO::ATTR_CONNECTION_STATUS)

大兔子大兔子 提交于 2019-12-08 22:17:41
问题 I have been looking in to this almost all day.. and can't seem to find the values returned anywhere. Can somebody tell me: What values do PDO::getAttribute(PDO::ATTR_CONNECTION_STATUS); return? Is it possible to rely on its result to determinate if the connection is still alive?(And eventually, what could I use to check if the connection is still alive?) 回答1: Finally! it turns out that the mysqli::ping() function could be implemented within PDO as follows: class PDOExtended extends PDO {

phonegap navigator.connection is undefined

百般思念 提交于 2019-12-08 20:46:13
问题 I've got a problem using Phonegap . I've created a Test application using console: phonegap create ProjectTest cordova platform add ios cordova build Then opened generated Xcode project and added new line to onDeviceReady function: onDeviceReady: function() { app.receivedEvent('deviceready'); // MY TEST alert(navigator.connection); } Also i've added this line to my config.xml: <plugin name="NetworkStatus" value="CDVConnection" /> So, result in alert is 'undefined'...... I just need to test

AS3 socket class connection with serproxy and sending data

丶灬走出姿态 提交于 2019-12-08 20:05:31
I am still struggling with AS3, but willing to learn as much as possible. I'm trying to write a small sample flash application which will be able to sent variables to the serial ports using socket class. I've done my homework and I know that flash can not sent data over serial ports like COM and USB. To do so you have to use use a program which will receive the outgoing data from Flash and send it to desire port. The best example of such process is described on Arduino website. From there I've learned that the best way is to use serproxy which I have downloaded and install on my Win7 machine.

Xamarin.Forms Previewer “Connection is closed”

不羁岁月 提交于 2019-12-08 17:26:30
问题 Just opened the Xamarin.Forms Previewer and it says "Something went wrong, Connection is closed" Its a fresh Visual Studio 2017 install and a blank Xamarin Forms Project. Here is a screenshot Does anyone know how to solve this problem? 回答1: Here's what worked for me. Make sure Android & Phone are selected in XF previewer. Now Close XF Previewer. Make sure your App.Android project is marked as the start up project . Restart VS Open the previewer again. I have no idea why the above worked for