On Wed, Aug 26, 2009 at 5:36 PM, Philip Thompson wrote:
> On Aug 26, 2009, at 2:47 PM, Bob McConnell wrote:
>
> From: Philip Thompson
>>
>>> On Aug 26, 2009, at 11:56 AM, Bob McConnell wrote:
>>>
From: Philip Thompson
>
> During a socket read, why would all the requested number
On Aug 26, 2009, at 2:47 PM, Bob McConnell wrote:
From: Philip Thompson
On Aug 26, 2009, at 11:56 AM, Bob McConnell wrote:
From: Philip Thompson
During a socket read, why would all the requested number of bytes
not
get sent? For example, I request 1000 bytes:
This is actually in a loop,
From: Philip Thompson
> On Aug 26, 2009, at 11:56 AM, Bob McConnell wrote:
>> From: Philip Thompson
>>>
>>> During a socket read, why would all the requested number of bytes
not
>>> get sent? For example, I request 1000 bytes:
>>>
>>> >> $data = @socket_read ($socket, 2048, PHP_BINARY_READ);
>>> ?>
From: Shawn McKenzie
> Bob McConnell wrote:
>> From: Philip Thompson
>>> During a socket read, why would all the requested number of bytes
not
>>
>>> get sent? For example, I request 1000 bytes:
>>>
>>> >> $data = @socket_read ($socket, 2048, PHP_BINARY_READ);
>>> ?>
>>>
>>> This is actually in a
Bob McConnell wrote:
> From: Philip Thompson
>> During a socket read, why would all the requested number of bytes not
>
>> get sent? For example, I request 1000 bytes:
>>
>> > $data = @socket_read ($socket, 2048, PHP_BINARY_READ);
>> ?>
>>
>> This is actually in a loop, so I can get all the data i
On Aug 26, 2009, at 11:56 AM, Bob McConnell wrote:
From: Philip Thompson
During a socket read, why would all the requested number of bytes not
get sent? For example, I request 1000 bytes:
This is actually in a loop, so I can get all the data if split up.
So,
for example, here's how the d
From: Philip Thompson
>
> During a socket read, why would all the requested number of bytes not
> get sent? For example, I request 1000 bytes:
>
> $data = @socket_read ($socket, 2048, PHP_BINARY_READ);
> ?>
>
> This is actually in a loop, so I can get all the data if split up. So,
> for examp
Philip Thompson wrote:
> Hi.
>
> During a socket read, why would all the requested number of bytes not
> get sent? For example, I request 1000 bytes:
>
> $data = @socket_read ($socket, 2048, PHP_BINARY_READ);
> ?>
>
> This is actually in a loop, so I can get all the data if split up. So,
> for
With any code doing a basic socket functionality, the code that i gave in
the original post is suppossed to connect to a deamon, and get a message
from it , instead it "makes the deamon go crazy" in the sense that it starts
endless looping and loads the system resources up to max.
"Jim Lucas" <
vixle wrote:
> well i mean even if we would not consider that particular piece of code as
> an example of the code that i have issues with im still rather interesting
> if theres some different between the socket model used by say, c++(winsock
> in my case) and the sockets used in php
> because
well i mean even if we would not consider that particular piece of code as
an example of the code that i have issues with im still rather interesting
if theres some different between the socket model used by say, c++(winsock
in my case) and the sockets used in php
because when made a simple c++
figured id top-post on this one, since the original message was so long..
i recommend debugging with a tool like wireshark. that way you can
see whats in the packets going over the wire and hopefully it will lead
to a solution.
-nathan
On Dec 19, 2007 12:54 AM, vixle <[EMAIL PROTECTED]> wrote:
this code doesn't interact with php client while with c++ based one it
works just fine.
.anybody?
#include
#include
#include
#include
using namespace std;
int i = 0;
int ar = 0;
const int is = 50;
SOCKET stack[is];
void clientserve(void* ws)
{
SOCKET wsocket = *(SOCKET*)ws;
int fgotus
this code doesn't interact with with php client while with c++ based one it
works just fine.
.anybody?
#include
#include
#include
#include
using namespace std;
int i = 0;
int ar = 0;
const int is = 50;
SOCKET stack[is];
void clientserve(void* ws)
{
SOCKET wsocket = *(SOCKET*)ws;
int f
On Wed, May 2, 2007 6:29 am, [EMAIL PROTECTED] wrote:
> I need to do some socket work on a production machine that is
> constantly
> busy so I don't dare re-compile php. Anybody know if it's possible to
> load
> the socket functions dynamically, maybe as if they were in a module?
If you can do --w
Am Mittwoch, 2. Mai 2007 14:36 schrieb Oliver Block:
> --with-socket=shared
Actually it should be --enable-sockets=shared
Regards,
Oliver
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Am Mittwoch, 2. Mai 2007 13:29 schrieb [EMAIL PROTECTED]:
> I need to do some socket work on a production machine that is constantly
> busy so I don't dare re-compile php. Anybody know if it's possible to load
> the socket functions dynamically, maybe as if they were in a module?
It's possible if
Thanks for the answer.
In the meantime I've managed to solve the problem be removing the
pcntl_wait call. Actually I think this is a bug, because as I
understand things pcntl_wait shouldn't block the main process, but I
don't have experience with either sockets or Unix process, so I might
be wrong
On Tue, March 20, 2007 8:27 am, Adrian Gheorghe wrote:
> I've sent a bug report earlier and it got marked as bogus, so I
> decided to ask here about a possible solution. You can see the bug
> report at http://bugs.php.net/bug.php?id=40864
Looks like a pretty cogent bug report to me...
Perhaps Ton
On 7/13/05, Greg Donald <[EMAIL PROTECTED]> wrote:
> `php -h` tells you all the command line options.. and all the basic
> fuctionality is covered in the manual online. Seems complete to me.
ehmm you weren't refering to the CLI version but anyways, I'd be
grateful to anyone who points me to more
On 7/12/05, Ahmed Saad <[EMAIL PROTECTED]> wrote:
> yeah the manual is completely drak when it comes to php CLI binary
`php -h` tells you all the command line options.. and all the basic
fuctionality is covered in the manual online. Seems complete to me.
--
Greg Donald
Zend Certified Engineer
Hi André,
On 7/12/05, André Medeiros <[EMAIL PROTECTED]> wrote:
> Since there was no reference to that on the PHP manual, I thought about
> mentioning it just to be safe.
yeah the manual is completely drak when it comes to php CLI binary
--
PHP General Mailing List (http://www.php.net/)
To unsub
Since there was no reference to that on the PHP manual, I thought about
mentioning it just to be safe.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
hi all,
> On Tue, 2005-07-12 at 16:49 +0200, daro wrote:
> Also remember to set_time_limit(0) ;)
PHP ENTER CONFUSION
The *CLI* version of php has no max execution time by default (0)
- Where's the php CLI version in php4?
[PHP_HOME]/cli/php.exe and it reads a php.ini if it was in the SAME
direc
Please, PLEASE "Reply to All"!
Yes, you have to add something like
--8<-
while(true) {
// code here
if( $someConditionThatWillMakeMeExit ) {
break;
}
sleep(1); // to prevent excessive processor
On Tue, 2005-07-12 at 09:58 -0500, Greg Donald wrote:
> On 7/12/05, daro <[EMAIL PROTECTED]> wrote:
> > I don't know where should I put this script to be able to receive all
> > datas and respond
> > with proper strings.
>
> You would run the script as a shell script from the command line.
>
>
You should use/run it via PHP-CLI. It is a shell script.
Ex: /usr/local/bin/php socket.php (on linux) or
C:\PHP\php.exe socket.php (on windooz/M$-dos)
Good luck.
Hidayet Dogan
On Tue, 12 Jul 2005, daro wrote:
Hi.
I'm writing a TCP/IP server and client.
On your website I found ready php sc
On Tue, 2005-07-12 at 16:49 +0200, daro wrote:
> Hi.
> I'm writing a TCP/IP server and client.
> On your website I found ready php script http://pl2.php.net/sockets but I
> have a question.
>
> For TCP/IP server the example script from your website has to be put on
> server as index.php file an
On 7/12/05, daro <[EMAIL PROTECTED]> wrote:
> I don't know where should I put this script to be able to receive all datas
> and respond
> with proper strings.
You would run the script as a shell script from the command line.
On windows you can just save the code as a regular php script then
sta
Hi,
I think curt is right about transfer encoding being a problem, however i
feel it may not be 'the' problem. This timing issue looks like you are
running into a 'blocking' kind of situation. Cosmin, Have you tried the
'Connection: close' header?
Getting back to transfer encoding you might wan
* Thus wrote Cosmin ([EMAIL PROTECTED]):
> On Sun, 2003-10-26 at 15:30, Raditha Dissanayake wrote:
> > are you getting any 1xx status codes from the web server?
>
> here are the full headers:
>
> Transfer-Encoding: chunked
This is probably the problem. If you inspect your data, you'll
notice that
On Sun, 2003-10-26 at 15:30, Raditha Dissanayake wrote:
> are you getting any 1xx status codes from the web server?
here are the full headers:
HTTP/1.1 200 OK
Date: Mon, 27 Oct 2003 06:15:30 GMT
Server: Apache/1.3.27 (Unix) PHP/4.3.3
X-Powered-By: PHP/4.3.3
Transfer-Encoding: chunked
Content-Type:
are you getting any 1xx status codes from the web server?
Cosmin wrote:
I'm trying to make an application using XML-RPC, and I have the
following problem: I use fsockopen() to simulate a POST to my local
web-server. All goes very well except it's very very slow. Here is my
code maybe someone coul
On Sat, 2003-10-25 at 17:42, Curt Zirzow wrote:
> * Thus wrote Cosmin ([EMAIL PROTECTED]):
> > I'm trying to make an application using XML-RPC, and I have the
> > following problem: I use fsockopen() to simulate a POST to my local
> > web-server. All goes very well except it's very very slow. Here
* Thus wrote Cosmin ([EMAIL PROTECTED]):
> I'm trying to make an application using XML-RPC, and I have the
> following problem: I use fsockopen() to simulate a POST to my local
> web-server. All goes very well except it's very very slow. Here is my
> code maybe someone could tell me what I'm doing
Probably your problems about "i can send about seven messages per second"
may be relationed to
OS's tcp connection stream buffering... try to flush every fd after write to
it. I wrote a multi-threaded (pcntl_fork())
application in phpcli using many sockets and they worked well... array
iterations a
I'm not sure if it would be helpful, but I wrote a quick PHP socket
application that implements a specialized HTTP proxy. It's a quick
hack of sorts, but I have found it to be very stable, and it uses the
latest sockets API. It consists of only one small PHP script, and
it's fairly well commented.
This is how sockets work, if you close the process holding the socket,
the conection is closed.
There is no function reopen_the_old_conection. You are not clear about
what you are trying to
achive, but maybe you should rethink your design.
Gareth Thomas wrote:
Hi,
I am running 4.3.0pre2 on RH
Yep, if you're using UNIX and compiling from source, you must add this
switch to the command line when you're configuring and compiling PHP:
--enable-sockets
(e.g.: ./configure --enable-sockets). If you're using a prepackaged
version (RPM or Windows) then you should look into the documentation
On Sat, 6 Jul 2002, Zac Hillier wrote:
> I'm opening a port on a remote machine presently I'm using fsockopen() which
> is fine for opening the port and sending data however I'm having trouble
> reading data back from the port.
>
> So I've considered using socket functions but do not appear to be
MAIL PROTECTED]]
> > Sent: Tuesday, April 09, 2002 11:12 AM
> > To: dietrich
> > Cc: [EMAIL PROTECTED]
> > Subject: Re: [PHP] sockets and flush()
> >
> >
> > dietrich wrote:
> > >
> > > i have a script that makes a socket connection about halfw
Are you using ob_start () and ob_end_flush() ?
If not then declaring ob_start () as the very first "mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 09, 2002 5:39 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] sockets and flush()
no tables. my test script prints a s
no tables. my test script prints a single string prior to the sockets code.
thx,
dietrich
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 09, 2002 11:12 AM
> To: dietrich
> Cc: [EMAIL PROTECTED]
> Subject: Re: [P
dietrich wrote:
>
> i have a script that makes a socket connection about halfway through the
> page.
>
> nothing on the page prints until the socket operation is finished, even if i
> call flush() prior to the socket operation.
>
> does anyone now of a way to force PHP to output the buffer prio
Socket() function does not exist in PHP at all. Use fsockopen() instead.
http://www.php.net/fsockopen
Sincerely,
Maxim Maletsky
Founder, Chief Developer
PHPBeginner.com (Where PHP Begins)
[EMAIL PROTECTED]
www.phpbeginner.com
> -Original Message-
> From: Odd Arne Beck [mailto:[E
On Tue, 19 Mar 2002, Hunter, Ray wrote:
> Has anyone created a telnet session in php with sockets and can give me some
> help on setting one up?
Take a look at PHP Shell to see how it's done.
http://www.gimpster.com/php/phpshell/index.php
Cheers,
Nick Winfield.
--
PHP General Mailing List
As I said, you're probably better off with fsockopen() anyway. Remember,
the oure socket functions are experimental (or at least were last time I
checked that part of the manual) and you never really know with experimental
things. As well, they may change at any time, rendering your scripts
usel
That's the first thing I tried- doesn't work with the lower-level sockets.
(the socket_* functions)
Right now I have an fsockopen version, and I'm commenting out the socket
version- hopefully I'll be able to get it to work later.
Thanks, but do you have any other ideas???
-Evan
On Mond
the Servlet does not respond to Get requests..
>
> any more ideas pl???
>
> Thnx...
>
> sands
>
> -Original Message-
> From: Evan Nemerson [mailto:[EMAIL PROTECTED]]
> Sent: segunda-feira, 4 de Fevereiro de 2002 15:25
> To: Sandeep Murphy
> Cc: [EMAIL PROTEC
I've found fsockopen to be very reliable. I've done a few socket scripts
with PHP (WhoisPro, et al).
I believe the easiest way to check for a remotely closed socket is to do an
fgets() and check for EOF:
while (!feof($connection)) {
$buffer .= fgets($connection, 4096); // 4096 is the ch
: [PHP] sockets
> The server does listen on port 80 as i can access it via browser...
>
"http://srv157:7001/Palmeira2Application/palmeira2.servlets.communicator.Co
>m municator";
Am I missing something here? What's "srv157:7001"? Why don't you first try
> The server does listen on port 80 as i can access it via browser...
> "http://srv157:7001/Palmeira2Application/palmeira2.servlets.communicator.Co
>m municator";
Am I missing something here? What's "srv157:7001"? Why don't you first try
http://www.google.com?
Bogdan
--
PHP General Mailing Li
Nemerson [mailto:[EMAIL PROTECTED]]
Sent: segunda-feira, 4 de Fevereiro de 2002 15:25
To: Sandeep Murphy
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] sockets
This should help you. It is the fsockopen version of what I posed about 6
hours ago.
function getdata ($host, $port, $data)
{
$fp
This should help you. It is the fsockopen version of what I posed about 6
hours ago.
function getdata ($host, $port, $data)
{
$fp = fsockopen ( $host, $port, $ec, $es, 5.0);
if ( !$fp )
{
exit ("ERROR $ec: $es\n");
}
fputs ($fp, $data);
I am aware of cURL, but I want to just use the standard PHP stuff if I can
because I plan on releasing this when I'm done, and want to KISS for other
people.
I know people have to compile PHP with sockets, but they will anyways for
this project- I'm going to need socket_listen and socket_creat
A quick note...
If you are not aware of cURL (curl.haxx.se), then you may want to look into it.
If you are, then please disregard this post.
-Jason Garber
At 11:06 PM 2/3/2002 -0800, Evan Nemerson wrote:
>Anyone know if there is a way yet to see if a socket is still connected to a
>host? I wan
On Wed, 3 Oct 2001 02:02, Devon Weller wrote:
> Has anyone successfully gotten socket functions to work with FreeBSD?
> More specifically, Mac OS X?
>
> I always get the following error: Can't bind to port 12345, exiting.
>
> The script works fine on Linux machines. Is there a patch in the works
Oops,
socket_setopt($listener, SOL_SOCKET, SO_REUSEADDR, 1);
=
*
Know more about me:
http://www.geocities.com/mimodit
*
__
Do You Yahoo!?
Listen to your Yahoo! Mail messages from
Hi,
A bind error means that the port is being used by
another application, incase that's incorrect you can
assure yourself by doing this :
socket_setopt(listener, SOL_SOCKET, SO_REUSEADDR, 1);
This function is undocumented (yet) and would require
you to download the latest version from CVS.
Ho
If you get the "call to undefined function" error, I'd say that it doesn't
have the socket functions built in. I'm not positive, that'd be my guess
though.
Tyler Longren
Captain Jack Communications
[EMAIL PROTECTED]
www.captainjack.com
On Thu, 09 Aug 2001 15:19:40 +0100
"Michael Quinn" <[EMAI
well, if they did, and they made a full telnet class, then great!! give us
all the class!!
BUT, if they wrote their own socket listener, essentially their own
protocol, then it would work.
but if you are using sockets to connect to a real telnet server (as it were)
then you MUST have the negotia
> -Original Message-
> From: Lindsay Adams [mailto:[EMAIL PROTECTED]]
>
> No, your problem is most likely that you didn't do anything with
> the telnet
> negotiation phase.
[..]
That doesn't sound very encouraging :-(
Anyway, I got that idea of splitting an application into a codebase
No, your problem is most likely that you didn't do anything with the telnet
negotiation phase.
Read the RFC on telnet, and you will find that there is a whole
client-server negotiation phase going on. Kinda like a modem handshake.
It is really quite difficult, and no one has ported a Telnet class
Yasuo Ohgaki wrote:
> set_nonblock() is in PHP C source, but not in the PHP Manual. May be it's dead?
>
> It seems it take one parameter (file descriptor), let us know if it works. I
> might want to use it in the future :)
Yasuo,
There is one mention of set_nonblock() in the manual under
acc
set_nonblock() is in PHP C source, but not in the PHP Manual. May be it's dead?
It seems it take one parameter (file descriptor), let us know if it works. I
might want to use it in the future :)
>From socket.c
529 /* {{{ proto bool set_nonblock(int fd)
530Sets nonblocking mode for file des
Plutarck wrote:
> Very recently (a few days at most ago) someone was complaining about the
> problem you are having.
>
> According to them they can't get the socket function to accept socket
> nonblocking.
>
> It would seem that the function is broken, so you can't set nonblocking to a
> valid
Very recently (a few days at most ago) someone was complaining about the
problem you are having.
According to them they can't get the socket function to accept socket
nonblocking.
It would seem that the function is broken, so you can't set nonblocking to a
valid value at the current time.
Hopef
The online manual has some working examples
Also, using the socket funcs in Php isn't very different from using them in
C - try searching www.google.com if the examples in the manual aren't enough
jason
- Original Message -
From: "Boget, Chris" <[EMAIL PROTECTED]>
To: "Php (E-mail)" <[
68 matches
Mail list logo