473,385 Members | 2,162 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Check if user's connection is still open

I want to find out if a user's connection is still open because I will
be sending him files of up to 100MB and I don't want to be wasting
bandwidth sending data to nowhere.
Feb 3 '08 #1
3 4384
On Feb 2, 7:52 pm, Bruno Rafael Moreira de Barros
<brunormbar...@gmail.comwrote:
I want to find out if a user's connection is still open because I will
be sending him files of up to 100MB and I don't want to be wasting
bandwidth sending data to nowhere.
By default, if the connection is closed your script won't continue to
run. That sounds like what you want.

If you want to change that behavior you can use ignore_user_abort().
There's plenty of information on the subject here:

<http://www.php.net/manual/en/features.connection-handling.php>
Feb 3 '08 #2
On Feb 3, 12:56 am, ZeldorBlat <zeldorb...@gmail.comwrote:
On Feb 2, 7:52 pm, Bruno Rafael Moreira de Barros

<brunormbar...@gmail.comwrote:
I want to find out if a user's connection is still open because I will
be sending him files of up to 100MB and I don't want to be wasting
bandwidth sending data to nowhere.

By default, if the connection is closed your script won't continue to
run. That sounds like what you want.

If you want to change that behavior you can use ignore_user_abort().
There's plenty of information on the subject here:

<http://www.php.net/manual/en/features.connection-handling.php>
Oh thanks, I didn't think it did because one day I was using a script
that executed a system call and when I clicked cancel with my firefox
it didn't stop working, but that's because PHP doesn't have any
control about external programs, right?
Feb 3 '08 #3
You can test connection_aborted() after setting
ignore_user_abort(true).

On Feb 2, 7:52 pm, Bruno Rafael Moreira de Barros
<brunormbar...@gmail.comwrote:
I want to find out if a user's connection is still open because I will
be sending him files of up to 100MB and I don't want to be wasting
bandwidth sending data to nowhere.
Feb 3 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Colin Steadman | last post by:
I have built a page that lists all our databases, the users connected to each database, and what application they are using. Because these databases are moved, or removed from time to time I need...
11
by: Wolfgang Kaml | last post by:
Hello All, I have been working on this for almost a week now and I haven't anything up my sleeves anymore that I could test in addition or change.... Since I am not sure, if this is a Windows...
1
by: Agnes | last post by:
in form_load, i will new a sql connection ,fill in the dataset and then close the connection. I use Netstat to check the status. (1)Open the form , The status to the SQL server is "ESTABILISHED"...
1
by: srinivas | last post by:
Hi, I need to move the file from one system to another system in secured network.For this client is using cisco vpn client.I need to check the cisco vpn connection state before moving the...
0
by: nivas.meda | last post by:
Hi, I need to move the file from one system to another system in secured network.For this client is using cisco vpn client.I need to check the cisco vpn connection state before moving the...
14
by: martin1 | last post by:
All, I want to check wether db connection/open or not, if not it will post db connection error to user in message box The code is like: Dim objConnection As New SqlConnection _...
16
by: crbd98 | last post by:
Hello All, Some time ago, I implemented a data access layer that included a simple connectin pool. At the time, I did it all by myself: I created N connections, each connection associated with...
4
by: Fred Zuckerman | last post by:
I have a A2K database that includes some linked tables (these links are SQL views). Sometimes there are "issues" with the SQL server and the users receive a timeout error whenever they try to...
7
by: fniles | last post by:
I am using VB.Net 2003 and MS Access (connecting using OleDBConnection). I read using DataAdapter and DataSet, not DataReader. When many people try to access the database at the same time, I get...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.