w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Does a TCP peer reset the connection after exhaust the send retry counter?
In the absence of an ACK for the entire send window, the sender assumes that that the peer has gone away and silently cleans up the connection (no FINs or RSTs sent at this stage) after retries. If the peer was actually alive and sends a packet on the old connection, the sender will then send a RST.

Categories : Windows

python, send many HTTP requests through one network connection
The fact that both solutions shared some code like Lukasa said, and the fact that both results were equivalent whenever querying Apache or Tomcat made me first think it was related to the Python code. But in fact it was related to the servers configurations. The trick is that both Apache and Tomcat share a setting which indicates how many HTTP requests can be made within the same TCP connection. And both have a default value of 100. Tomcat: maxKeepAliveRequests: The maximum number of HTTP requests which can be pipelined until the connection is closed by the server. If not specified, this attribute is set to 100. See http://tomcat.apache.org/tomcat-7.0-doc/config/http.html#Standard_Implementation Apache: MaxKeepAliveRequests: The MaxKeepAliveRequests directive limits th

Categories : Python

How can you hold a TCP connection open for multiple send/receive requests?
Finally figured it out, @Idle_Mind definitely had the right suggestion, the using{} block was causing the connection to be held. The problem when I first removed the using was that the client was accidentally closing the connection after the first loop. I remedied the issue on the client end and now just loop and hang on a wait, was still wondering if there was a way to time out eventually (if the client does nothing for say 1 minute), but I'm okay with having the client end the connection.

Categories : C#

Unable to send data multiple requests in a single connection — socket error
The connection was closed because you called conn.getresponse() and the server closed it. There isn't much that you can do about it from your side of the connection aside from passing a Connection: keep-alive header and hope that the server will comply. If you want to send another HTTP request, you have to start with conn.putrequest("POST", path) or something similar.

Categories : Python

failed (104: Connection reset by peer)
The above nginx error indicate that issue is related to the fastcgi(php-fpm). After enabling the "catch_workers_output" on /etc/php5/fpm/pool.d/www.conf Got the relevant error on php5-fpm.log. Now understand that issue is related to AMQP module. [21-Aug-2013 23:32:57] WARNING: [pool www] child 16091 said into stderr: "php-fpm: pool www: symbol lookup error: /usr/lib/php5/20090626/amqp.so: undefined symbol: amqp_open_socket" Issue has been fixed afterrecompiled and install amqp module

Categories : PHP

MongoDB connection reset by peer
Not sure if this is an answer or even makes sense, but I added one more loop in my insert sequence, and that corrected the problem. It seems that the original object I thought I was inserting was actually a list of documents instead of document-level, and this was implicitly batch-inserted---when I thought I was actually inserting one document at a time, I thought I was already looping at the document level. It appears that over the course of the batch insert, the connection closed.

Categories : Json

C Sockets recv: connection reset by peer
Since you didn't post full code, I am going to take a stab at it and make an assumption: You populate the format string of "GET %s HOST:%s " with restOfURL and baseServer However, during the time of the sprintf call restOfURL isn't initilized so you're pushing garbage data into the first %s Either post more of your code or make sure you initialize resOfURL

Categories : C

Connection Reset by Peer with Python module urllib
If you don't know the exact problem, you can catch all exceptions as so: try: urllib.request.urlretrieve(myUrl['link'],str(count)+'.jpg') except URLError as e: print(e.reason) except KeyboardInterrupt as ki: raise ki except: print("Unknown Error")

Categories : Python

php5-fpm + nginx + google bot = connection reset by peer
If you look a the error message, it says while reading response header from upstream Which means that the issue is not that google is terminating the request, but rather that nginx's upstream, which happens to be php-fpm, is terminating the request. Usually, this is caused by an error the the php code being ran. Given that we don't have the code, here are some general troubleshooting steps: In php-fpm's configuration, increase the values of request_terminate_timeout, max_input_time and max_execution_time. Activate error logging in the php.ini or pool .conf configuration files (but not "display_error", if it's a production website). Try running a debugger on the running code (xdebug is very useful) to step through the code and you'll stumble upon most issues.

Categories : Nginx

fatal: read error: Connection reset by peer
For the first issue vijay13@ubuntu:~$ git clone git://anongit.kde.org/plasma-mediacenter Cloning into 'plasma-mediacenter'... fatal: read error: Connection reset by peer Here you are trying to check out a code by using the above command. I even encounter this error : Connection reset by peer when try to check out a code. It is a problem with your internet connection. Check your internet connection and try again. It helped me.

Categories : GIT

Connection reset by peer Exception in Soap Webservice calling
Check out following links may be one of them solves your problem link1 link2 link3 These links consist of some solution at client side and some on server side and also they provide information why its happening. Let me know if this helps you.

Categories : Android

Random PHP FastCGI / Connection reset by peer / incomplete headers
This issue is generally not just Host specific, it is developer related as well, depending on the configuration. However some hosts are rather strict with FastCGI and will limit your capabilities. It is generally easier to run without using FastCGI and just use mod_php unless you have specific need to use FastCGI in your application. We would need to see your fcgi wrapper (what's in /dev/shm/blackmou-php.fcgi) or .htaccess for FastCGI spawning, to better assist you without knowing which files and the code that is on those files the issue occurs with. Also do your hosts use Apache, LightHttpd, or Nginx (or combination)? At that point I strongly suggest updating to use PHP 5.3.9+ As this can be caused by any number of issues, FastCGI effectively prevents your site/scripts from being attack

Categories : PHP

How to limit download rate of HTTP requests in requests python library?
There are several approaches to rate limiting; one of them is token bucket, for which you can find a recipe here and another one here. Usually you would want to do throttling or rate limiting on socket.send() and socket.recv(). You could play with socket-throttle and see if it does what you need. This is not to be confused with x-ratelimit rate limiting response headers, which are related to a number of requests rather than a download / transfer rate.

Categories : Python

python-requests returning unicode Exception message (or how to set requests locale)
You can try os.strerror, but it would probably return nothing or the same non-English string. This hard-coded English was scraped from here: http://support.microsoft.com/kb/819124 ENGLISH_WINDOWS_SOCKET_MESSAGES = { 10004: "Interrupted function call.", 10013: "Permission denied.", 10014: "Bad address.", 10022: "Invalid argument.", 10024: "Too many open files.", 10035: "Resource temporarily unavailable.", 10036: "Operation now in progress.", 10037: "Operation already in progress.", 10038: "Socket operation on nonsocket.", 10039: "Destination address required.", 10040: "Message too long.", 10041: "Protocol wrong type for socket.", 10042: "Bad protocol option.", 10043: "Protocol not supported.", 10044: "Socket type not supported.",

Categories : Python

.htaccess rewrite to add .php to no extension requests, BUT to not accept .php requests by users
I am not a htaccess guru yet, but I hope this helps: RewriteCond %{THE_REQUEST} .php RewriteRule .php$ - [R=404] RewriteCond %{REQUEST_URI} !(.php) RewriteCond %{REQUEST_URI} !(^/error/.*$) RewriteRule ^(.*)$ $1.php [L]

Categories : Apache

Apache Camel - aggregator to space out requests, but not queuing requests
I believe you would be interested in seeing the Throttler pattern, which is documented here http://camel.apache.org/throttler.html Hope this helps :) EDIT - If you are wanting to eliminate excess requests, you can also investigate setting a TTL (Time to live) header within JMS and add a concurrent consumer of 1 to your route, which means any excess messages will also be discarded.

Categories : Apache

Consecutive requests with python Requests.Session() not working
In the lastest version of requests, he sessions object is with Cookie Persistence, look the requests Sessions ojbects docs. So you don't need add the cookie artificialy. Just import requests s=requests.Session() login_data = dict(userName='user', password='pwd') ra=s.post('http://example/checklogin.php', data=login_data) print ra.content print ra.headers ans = dict(answer='5') r=s.post('http://example/level1.php',data=ans) print r.content Just print the cookie to look up wheather you were logged. for cookie in s.cookies: print (cookie.name, cookie.value) And is the example site is yours? If not maybe the site reject the bot/crawler ! And you can change your requests's user-agent as looks likes you are using a browser. For example: import requests s=requests.Session() headers

Categories : Python

Why doesn't requests.get() return? What is the default timeout that requests.get() uses?
What is the default timeout that get uses? I believe the timeout is None, which means it'll wait (hang) until the connection is closed. What happens when you pass in a timeout value? r = requests.get( 'http://www.justdial.com', proxies={'http': '222.255.169.74:8080'}, timeout=5 )

Categories : Python

How to redirect all HTTPS requests to HTTP requests?
In the Global.asax file try something like. protected void Application_BeginRequest() { if (Context.Request.IsSecureConnection) Response.Redirect(Context.Request.Url.ToString().Replace("https:", "http:")); }

Categories : Asp Net Mvc

How do you create a peer to peer connection without port forwarding or a centeralized server?
It is possible. I see at least 2 parts to your question. (It is not going to be HTTP packet. It is a lot more complex then that.) First off, I believe you might be talking about a concept called decentralized P2P network. The main idea idea behind decentralized peer-to-peer network is the fact that nodes conjoint in such a network will not require central server or group of servers. As you might already know, most common centralized peer-to-peer networks require such centralized system to exchange and maintain interconnectivity among nodes. Basic concept is such, as new node will connect to one of the main servers to retrieve information about other nodes on the network to maintain its connectivity and availability. Central system gets maintained through servers constantly synchronizing

Categories : Misc

How to do network tracking or debugging WebRTC peer-to-peer connection
If you're using Chrome, you can navigate to chrome://webrtc-internals. This will show you the offer, answer, ICE states, and statistics about the connection (once it has been established). For more in-depth debugging, you can see logs of all the STUN pings between candidates by starting Chrome with the following flags: --enable-logging --v=4 The logs will be in the chrome_debug.log file in your user data directory: http://dev.chromium.org/user-experience/user-data-directory

Categories : Misc

iOS - Can't send Facebook requests
NSString *query2 = [NSString stringWithFormat:@"SELECT uid, name, pic_square,is_app_user FROM user WHERE is_app_user = 1 AND uid IN " @"(SELECT uid2 FROM friend WHERE uid1 = me())"]; // Set up the query parameter NSDictionary *queryParam2 = @{ @"q": query2 }; // Make the API request that uses FQL [FBRequestConnection startWithGraphPath:@"/fql" parameters:queryParam2 HTTPMethod:@"GET" completionHandler:^(FBRequestConnection *connection, id result, NSError *error) { if (error) { } else {

Categories : IOS

Testing AJAX requests/Twitter Oauth with RSpec/Capybara (Poltergeist)
BTW! In your OmniAuth.config.mock_auth[:twitter] You have a :user_info key, but in a User model (create_from_omniauth) you're trying to get auth["info"]["nickname"] Change this: def self.create_from_omniauth(auth) create! do |user| user.uid = auth["uid"] user.nickname = auth["info"]["nickname"] user.oauth_token = auth["credentials"]["token"] user.oauth_secret = auth["credentials"]["secret"] end end To this: def self.create_from_omniauth(auth) create! do |user| user.uid = auth["uid"] user.nickname = auth["user_info"]["nickname"] user.oauth_token = auth["credentials"]["token"] user.oauth_secret = auth["credentials"]["secret"] end end That may solve the problem for you

Categories : Ruby On Rails

How do you set up a peer-to-peer connection for an online game built for the web?
Cube Slam uses the Channel API for messaging/signaling, along with Ajax. The HTML5 Rocks WebRTC article describes how this is done for the apprtc.appspot.com video chat app. Another alternative, as you suggest, is to use something like Socket.IO. I built a codelab that gives step by step instructions on how to do that: bitbucket.org/webrtc/codelab.

Categories : Javascript

Cross server MySQL connection and requests
Keep in mind, when running a CPU intensive operation in Node the whole application blocks as it runs in a single thread. If you're going to run a CPU intensive operation in Node, make sure you spawn it off into a child process who's only job is to run the calculation and then return to the primary application. This will ensure your Node app is able to continue responding to income requests as the data is being processed. Now, onto your question. Having the database on a different server is extremely common and typically is a good practice to have. Where you can run into performance problems is if your database is in a different data center entirely. The further (physically) your database server is from your application server, the more latency there will be per request. If these request

Categories : PHP

SignalR connection freeze other ajax requests
Taking @bjornhol's answer a little further - the same issue of all SignalR requests (which were loading more AJAX) queuing up was happening to me too. I thought it was jQuery which was the issue but in actual it is the session state. For that controller if you can set the SessionStateBehaviour to ReadOnly or Disabled you will see the requests go through simultaneously. Please see this link too http://johnculviner.com/asp-net-concurrent-ajax-requests-and-session-state-blocking/ Hope this helps.

Categories : Jquery

How to Send N number of Requests at Same Time in IOS
There are a few ways to do this. Grand Central Dispatch dispatch_async(dispatch_queue_create("com.myApp.uploadXml", DISPATCH_QUEUE_CONCURRENT), ^(void) { //Upload here . . }); You can set the number of concurrent requests as follows: https://developer.apple.com/library/mac/#documentation/General/Conceptual/ConcurrencyProgrammingGuide/OperationQueues/OperationQueues.html BBHTTP The BBHTTP and other network libraries support this. For example the executor below has 10 concurrent requests. BBHTTPExecutor* xmlUploadExecutor = [BBHTTPExecutor initWithId:@"myApp.xmlUploder"]; xmlUploadExecutor.maxParallelRequests = 10; BBHTTPRequest* request = [[BBHTTPRequest alloc] initWithURL:[NSURL URLWithString:@"http://upload.url"] andVerb:@"PUT

Categories : IOS

How to share AmazonSQS connection over multiple requests on tomcat?
AWS SQS provides a stateless RESTful API, which means that there is no such thing as "connection". You connect to it, send your request, get your response, and close HTTP session. There is nothing to share.

Categories : Java

when and how does Google Anayltics send tracking requests
Their Javascript reads the cookies, then requests a GIF during the request, where they pass the parameters back to their system for tracking. When you look in Firebug, look at either ALL or Images. You should see a GIF that's been transfered from Google Analytics in your history. When they request the GIF they're also passing a long string of GET vars to the URL. They should also be providing you with a tracking cookie. Which is also set with the Javascript. Here's more about how Google Analytics works. How the Tracking Code Works In general, the Google Analytics Tracking Code (GATC) retrieves web page data as follows: 1. A browser requests a web page that contains the tracking code. 2. A JavaScript Array named _gaq is created and tracking commands are pushed onto the array

Categories : Google Analytics

Best way to send HTTP GET requests ansynchronously in Android?
You could do your own async HTTP GET calls using AsyncTask but I would recommend against it unless you're doing it from a learning point of view. If you want a nice, clean and stable solution I'd suggest that you use the well known Android Asynchronous Http Client 3rd party library. From the site: "An asynchronous callback-based Http client for Android built on top of Apache’s HttpClient libraries. All requests are made outside of your app’s main UI thread, but any callback logic will be executed on the same thread as the callback was created using Android’s Handler message passing." Making a GET is as easy as: AsyncHttpClient client = new AsyncHttpClient(); client.get("http://www.google.com", new AsyncHttpResponseHandler() { @Override public void onSuccess(String response

Categories : Android

$http doesn't send cookie in Requests
In your config, DI $httpProvider and then set withCredentials to true: .config(function ($routeProvider, $httpProvider) { $httpProvider.defaults.withCredentials = true; //rest of route code Info on angularjs withCredentials: http://docs.angularjs.org/api/ng.$http Which links to the mozilla article: https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS?redirectlocale=en-US&redirectslug=HTTP_access_control#section_5

Categories : HTML

How can you use threading to send multiple web requests at a time in c#?
In a WPF app, you should use both threads and Dispatcher, because only the UI thread can write to a label. More specifically, you should use the dispatcher as a callback to update anything in the UI when a task is complete: protected void SearchButtonClick(object sender, EventArgs e) { new Thread(() => MakeRequest(SearchForm.Text)).Start(); } protected void MakeRequest(string text) { int resultCount = search.MakeRequests(text); // tell UI thread to update label Dispatcher.BeginInvoke(new Action(() => { resultsLabel.Text += text + ": " + resultCount + " occurances"; })); } Edit1: use Dispatcher not just threads Edit2: use both Dispatcher and threads

Categories : C#

Using Apache mod_rewrite to send all requests to a file
Given that /var/www/ is the root folder then this would work: RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule . /sites/urlprocessor.php [L] Basically this will redirect any non-existent folder and file to the urlprocessor.php For more information on how to handle the redirect with your PHP you can refer yourself to this answer.

Categories : Apache

"Can only send requests to friends or users of this application"
I figured out that actually the people I was inviting weren't "my friends". The access token provided to fetch the friends and the one that the SDK logged in, and used to do the FB.ui request weren't the same. Sorry for your time...

Categories : Javascript

Can I change the connection pool size for Python's "requests" module?
This should do the trick: import requests sess = requests.Session() adapter = requests.adapters.HTTPAdapter(pool_connections=100, pool_maxsize=100) sess.mount('http://', adapter) resp = sess.get("/mypage")

Categories : Python

handling [Errno 111] Connection refused return by requests in flask
Catch the exception request.post raises using try-except: try: req = requests.post(buildApiUrl.getUrl('user') + "/login", data=payload) except requests.exceptions.RequestException: # Handle exception ..

Categories : Python

AngularJS - Does $resource requests send cookies automatically?
No. But if you want to send cookies, then you can try $cookies service to get the cookie and send with API either in the payload or included in the header. You can also set the cookie in a default header (with $cookies service injected) so you don't have to specify it in all API calls. var cookie = $cookies.myCookie; // suppose you already set $cookies.myCookie= 'xxx'; $http.defaults.headers.post.Cookies = cookie;

Categories : Angularjs

How to send parallel GET requests and wait for result responses?
Just in general, you need to encapsulate your units of work in a Runnable or java.util.concurrent.Callable and execute them via java.util.concurrent.Executor (or org.springframework.core.task.TaskExecutor). This allows each unit of work to be executed separately, typically in an asynchronous fashion (depending on the implementation of the Executor). So for your specific problem, you could do something like this: import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.concurrent.Callable; import java.util.concurrent.Executor; import java.util.concurrent.FutureTask; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.BasicResponseHandler; import org.apache.http.impl.client.DefaultHttpClient; import org.springframework.ste

Categories : Java

PHP send multiple event requests to Outlook/vcalendar
After trying multiple approaches, I was able to come up with a working solution. You need to send the event as a recurring event. 1st inner event should be the default event. This should include the RRULE specifying the recurring frequency & count. This should contain the same DTSTART, DTEND, DTSTAMP values of the 1st day event. All events including the default event should contain the same UID & SEQUENCE. Other than the default event, all other events should contain unique RECURRENCE-IDs. For further details refer to the blog post I have written regarding the solution: http://hasarangi.blogspot.com/2015/02/php-send-multiple-events-to-ms-outlook.html

Categories : PHP

java send GET/POST requests while maintaining cookies
HttpClient automatically handles cookies as long as you use the same DefaultHttpClient object.

Categories : Java



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.