473,386 Members | 1,715 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,386 software developers and data experts.

How can i send 'eof' to the client?

I want to send 'eof' kind of message after some processes. Die or exit
cannot be used because there are some more processes to complete, but
nothing major to users.

<?php
phpinfo ();
//i want to finish the process here!!
//flush () //? doesnt work?
sleep (10); // mimic of (not)complicated process
?

Help me to solve this problem :)

Calvin J

Jun 3 '06 #1
2 4659
S. C. Jeong wrote:
I want to send 'eof' kind of message after some processes. Die or exit
cannot be used because there are some more processes to complete, but
nothing major to users.

<?php
phpinfo ();
//i want to finish the process here!!
//flush () //? doesnt work?
sleep (10); // mimic of (not)complicated process
?


There might be many reasons why it doesn't work, as mentioned in the
manual along with hints of what to do.
http://php.net/manual/en/function.flush.php

Depending on how it is supposed to work, you might want to use
"ignore_user_abort", in case the user decides to go somewhere else
before your subsequent process finishes.
/Bent
Jun 3 '06 #2

S. C. Jeong wrote:
I want to send 'eof' kind of message after some processes. Die or exit
cannot be used because there are some more processes to complete, but
nothing major to users.

<?php
phpinfo ();
//i want to finish the process here!!
//flush () //? doesnt work?
sleep (10); // mimic of (not)complicated process
?

Help me to solve this problem :)

Calvin J


Try turning on output buffering and setting the Content-Length header
before sending the contents.

<?

ob_start();
/* ... do stuff ... */
$s = ob_get_clean();
$len = strlen($s);
header("Content-Length: $len");
echo $s;

?>

Might want to set the Connection header to 'closed' as well.

Jun 4 '06 #3

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

Similar topics

0
by: Mason Hoke | last post by:
I am using SQLXML3 to return me XML formatted result. All the attributes are double quoted. When I try to response.write it as an XML data island to the client side like nothing comes over to the...
11
by: TTroy | last post by:
Hello C programmers, Can someone tell me why ungetc can't sent back EOF, but it's sister function getc has no trouble sending it to us? For a file, this might not make a difference, but for an...
1
by: yezi | last post by:
Hi: I am coding a client and server program in C. My task is receive the command from the client and output the system call in server side and output to client side. Say client ----> "date"...
1
by: EppO | last post by:
I wrote a small server/client app. I created a class for my customized socket object using (synchronous) Sockets functions for both server and client use. When client connects to server, if It...
3
by: MilanB | last post by:
Hello I want to add some script code to every page on my application when page is about to send to client. I found some events that maybe can be used in this case (example:...
2
by: Don Isgitt | last post by:
Environment: Server running Redhat 3.2.3-20 on quad Xeon 2.4 Postgresql 7.4 compiled from source (gcc 3.2.3) Application written in Perl (5.8.0) using Tk, DBI and DBD Client accessing DB using...
3
by: ultr | last post by:
Hello, I have read that send() may not send whole message and returns the nuber of bytes sent, so that we can handle the rest of the message. Is it true, because i have tested sending even 1MB...
1
by: Sin Jeong-hun | last post by:
I need to write little applications with c/s model. I need basic features like, 1)The server should be able to handle multiple clients at the same time. (multithreaded) 2)The clients and the...
0
by: Jesus Suarez | last post by:
hello one example, How to send a client certificate by using the HttpWebRequest and HttpWebResponse classes in Microsoft Visual C# .NET
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.