On 7/27/10 7:04 AM, Ümit CAN wrote:
> I use PHP socket programming and I wish multithreading operation of
the socket .
> When I have many requests on this socket , before the first one request is
> anwered , the second request is not aswered till the first one is finished.
> How can both r
Ümit CAN wrote:
> I use PHP socket programming and I wish multithreading operation of
> the socket .
Don't use PHP, use C - it'll save you a lot of trouble in this context.
--
Per Jessen, Zürich (15.4°C)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.p
2009/6/29 Daniel Brown
> On Mon, Jun 29, 2009 at 02:42, Luke wrote:
> > Hey guys, getting an odd error here... The code involved:
> [snip!]
>
>Luke,
>
>Just a friendly reminder: for future reference, please don't start
> a second thread on the list until the first is closed out ---
> part
On Mon, Jun 29, 2009 at 02:42, Luke wrote:
> Hey guys, getting an odd error here... The code involved:
[snip!]
Luke,
Just a friendly reminder: for future reference, please don't start
a second thread on the list until the first is closed out ---
particularly if it's the same subject. Som
Luke wrote:
> Hey guys, getting an odd error here... The code involved:
>
> $master_socket = socket_create_listen($this->port);
>
> socket_bind($master_socket, '127.0.0.1', $this->port);
> socket_listen($master_socket);
> socket_set_option($master_
2009/6/29 Stuart
> 2009/6/29 Luke :
> > Hey guys, getting an odd error here... The code involved:
> >
> >$master_socket = socket_create_listen($this->port);
> >
> >socket_bind($master_socket, '127.0.0.1', $this->port);
> >socket_listen($master_socket);
> >
2009/6/29 Luke :
> Hey guys, getting an odd error here... The code involved:
>
> $master_socket = socket_create_listen($this->port);
>
> socket_bind($master_socket, '127.0.0.1', $this->port);
> socket_listen($master_socket);
> socket_set_option($master_so
On Sat, Jun 13, 2009 at 4:58 PM, HELP! wrote:
> On Sat, Jun 13, 2009 at 10:28 PM, Manuel Lemos wrote:
>
>> Hello,
>>
>> on 06/12/2009 11:41 AM HELP! said the following:
>> > hi
>> > I can not get the stream_get_contents() to work. it's returning empty.
>> > If you have a login details "ALOGINPASS
Thanks. I need to access remote data via TCP. Connecting to the given
port has been successful but getting acknowledgement from the remote server
after sending the login packet is a problem. Is there anything wrong sending
the login packet in strings? or what is the best way?
I probably think the
Hello,
on 06/12/2009 11:41 AM HELP! said the following:
> hi
> I can not get the stream_get_contents() to work. it's returning empty.
> If you have a login details "ALOGINPASS 1A" cant you just fwrite($ft,
> "ALOGINPASS 1A"); or do you need to add other things
>
>
> what is the meaning of this
HELP! wrote:
> hi
> I can not get the stream_get_contents() to work. it's returning empty.
> If you have a login details "ALOGINPASS 1A" cant you just fwrite($ft,
> "ALOGINPASS 1A"); or do you need to add other things
>
Depends upon what the server is expecting.
>
> what is the meaning of this s
Is it possible to do this with CURL instead of the socket functions
$bindip = 'xx.xx.xx.xx';
$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
socket_bind($sock, $bindip);
socket_connect($sock, 'ssl://epp.server.com', 80);
ie bind an IP and connect to an ssl:// address
Trying to connect via
Top postinng due to sendng from my cell phone...
I'd suggest you lookl at doing the ssl to the server ip address not the host
name, and from reading your other note, it looks like ssl: isnlt needed,
merely the name/ip of the server.
HTH,
Wolf
-Original Message-
From: Alan Willsher <[E
The sockets extension is a much "lower" level interface to sockets
than the fsockets/stream_ functions in PHP.
Unlike with the aforementioned, with the sockets extension, you can't
just expect to magically get an ssl connection by using "ssl://".
Your problem is that the sockets extension has no
--- Alan Willsher <[EMAIL PROTECTED]> wrote:
> Hi how do you use socket_create with an ssl server
>
> ie I would do something like
>
> $sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
> socket_bind($sock, $sourceip);
> socket_connect($sock, 'server.com', 2043);
>
> but if I do
>
> $sock =
> I dont get that error
>
> Warning: socket_write() expects parameter 1 to be resource, null given in
> /path/script.php on line 34
>
> but just the original error msg
>
> Warning: socket_write(): unable to write to socket [32]: Broken pipe in
Multiple times still?
Or just the one time?
Use h
It looks like you didn't pass in a socket resource as the first parameter to
socket_write.
http://php.he.net/manual/en/function.socket-write.php
> From: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]; php-general@lists.php.net
> Date: Mon, 8 Oct 2007 19:51:15 +0100
> Subject: Re: [P
, October 08, 2007 7:43 PM
Subject: RE: [PHP] Socket how to die if connection broken
Remove the @ and see if you get any useful message.
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
CC: php-general@lists.php.net
Date: Mon, 8 Oct 2007 19:04:45 +0100
Subject: Re: [PHP] Socket how to die if conn
Hi I got this error
Warning: socket_write() expects parameter 1 to be resource, null given in
/path/script.php on line 34
Thanks
- Original Message -
From: "Instruct ICC" <[EMAIL PROTECTED]>
To:
Sent: Monday, October 08, 2007 7:43 PM
Subject: RE: [PHP] Sock
Remove the @ and see if you get any useful message.
> From: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> CC: php-general@lists.php.net
> Date: Mon, 8 Oct 2007 19:04:45 +0100
> Subject: Re: [PHP] Socket how to die if connection broken
>
> Hi Stut Ive tried your example but
Hi Stut Ive tried your example but still cant get it to work.
- Original Message -
From: "Stut" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc:
Sent: Monday, October 08, 2007 5:26 PM
Subject: Re: [PHP] Socket how to die if connection broken
[EMAIL PROTECTE
AIL PROTECTED]>
To:
Sent: Monday, October 08, 2007 5:27 PM
Subject: RE: [PHP] Socket how to die if connection broken
But if the socket connection gets broken it creates an error msg
Warning: socket_write(): unable to write to socket [32]: Broken pipe in
Warning: socket_write(): unable to wri
> But if the socket connection gets broken it creates an error msg
>
> Warning: socket_write(): unable to write to socket [32]: Broken pipe in
> Warning: socket_write(): unable to write to socket [32]: Broken pipe in
> Warning: socket_write(): unable to write to socket [32]: Broken pipe in
>
>
[EMAIL PROTECTED] wrote:
Hi I have a socket connection like so..
$sourceip = '84.234.18.16'; // ip you want to bind to
$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
socket_bind($sock, $sourceip);
socket_connect($sock, 'dac.nic.uk', 2043);
if ($socket === false) {
$errorcode = socket
Try just leaving out the fclose($socket) and let PHP close it at the
end for you...
It's probably not IDEAL, but it may at least get you moving forward
with other bigger issues.
Check the http://bugs.php.net/ bugs as well -- Might be something in
there of use. There will be a few zillion bogus o
Thank you! Either of the two options fixed it! My guess is that
HTTP 1.0 does not need the "Connection: close" while HTTP 1.1 does.
So I had to fix one of the two... I did both, just so that my script
has better compatibility in the future.
Thanks again,
Alvar
At 06:59 2007/08/29, Eddie
On Wed 29 Aug 07, Alvar Saenz-Otero wrote:
> Hello,
> I have a small but somewhat annoying issue.
> Whenever I open a socket to another server, the file is read very
> quickly, but it takes the up to 30 seconds or so to close the
> connection...
>
> Here is what I do:
>$sever = "server.mit.edu"
On cs, 2007-02-01 at 14:45 +0100, Scripter47 wrote:
> Richard Lynch skrev:
> > On Wed, January 31, 2007 9:39 am, Németh Zoltán wrote:
> >> On sze, 2007-01-31 at 16:26 +0100, Scripter47 wrote:
> >>> I'm making a simple socket server that just receive some data, and
> >>> then
> >>> send some data ba
Richard Lynch skrev:
On Wed, January 31, 2007 9:39 am, Németh Zoltán wrote:
On sze, 2007-01-31 at 16:26 +0100, Scripter47 wrote:
I'm making a simple socket server that just receive some data, and
then
send some data back again to the client.
EDIT:
I forgot to tell that i need help!
I have sea
On Wed, January 31, 2007 9:39 am, Németh Zoltán wrote:
> On sze, 2007-01-31 at 16:26 +0100, Scripter47 wrote:
>> I'm making a simple socket server that just receive some data, and
>> then
>> send some data back again to the client.
>>
>> EDIT:
>> I forgot to tell that i need help!
>>
>> I have sear
On Tue, January 30, 2007 2:31 pm, Scripter47 wrote:
> I'm making a simple socket server that just receive some data, and
> then
> send some data back again to the client.
>
> it is a program that send data by sockets, (not port 80)
>
> It has to a simple solution :)
>
> plz ask for more infomation.
Stut skrev:
Németh Zoltán wrote:
On sze, 2007-01-31 at 16:26 +0100, Scripter47 wrote:
I'm making a simple socket server that just receive some data, and then
send some data back again to the client.
EDIT:
I forgot to tell that i need help!
I have search around for hours now, and the examples
Németh Zoltán wrote:
On sze, 2007-01-31 at 16:26 +0100, Scripter47 wrote:
I'm making a simple socket server that just receive some data, and then
send some data back again to the client.
EDIT:
I forgot to tell that i need help!
I have search around for hours now, and the examples are always no
On sze, 2007-01-31 at 16:26 +0100, Scripter47 wrote:
> I'm making a simple socket server that just receive some data, and then
> send some data back again to the client.
>
> EDIT:
> I forgot to tell that i need help!
>
> I have search around for hours now, and the examples are always not what
> I
I'm making a simple socket server that just receive some data, and then
send some data back again to the client.
EDIT:
I forgot to tell that i need help!
I have search around for hours now, and the examples are always not what
I needed :(
the program is written in Python, if that helps, and is
Scripter47 wrote:
I'm making a simple socket server that just receive some data, and then
send some data back again to the client.
Lovely.
it is a program that send data by sockets, (not port 80)
Excellent.
It has to a simple solution :)
Simple is usually the best way to go.
plz ask f
On Fri, October 13, 2006 11:15 am, Jeff Lanzarotta wrote:
How did you open the socket?
Did you check that it's valid?
You've already written to it, right?...
And Java got the data you sent?
One hack would be to try opening one socket just for reading and one
just for writing...
Might work out
On Thu, October 5, 2006 3:30 pm, João Cândido de Souza Neto wrote:
> I´m using CURL, but it cannot send any data to server by POST mothod.
>
> Have you got any example abaut this to show me?
$curl = curl_init();
curl_setopt($curl, 'https://example.com/example.php');
curl_setopt($curl, CURLOPT_POST
I´m using CURL, but it cannot send any data to server by POST mothod.
Have you got any example abaut this to show me?
Thanks.
""Richard Lynch"" <[EMAIL PROTECTED]> escreveu na mensagem
news:[EMAIL PROTECTED]
> You may want to look at using CURL which handles all the grunge of the
> SSL exchang
Out of PHP 4.3.0 fsockopen has been fixed up to do that.
""Richard Lynch"" <[EMAIL PROTECTED]> escreveu na mensagem
news:[EMAIL PROTECTED]
> You may want to look at using CURL which handles all the grunge of the
> SSL exchange...
> http://php.net/curl
>
> Or maybe fsockopen has been fixed up to d
You may want to look at using CURL which handles all the grunge of the
SSL exchange...
http://php.net/curl
Or maybe fsockopen has been fixed up to do that also?...
On Thu, October 5, 2006 12:33 pm, João Cândido de Souza Neto wrote:
> Hi everybody.
>
> I must to connect a https server by a fsockop
On Sun, May 7, 2006 11:22 pm, Oliver John V. Tibi wrote:
> while ($data != "") {
> $document .= $data;
> $data = socket_read( $resource, 1024 );
$logman->append("Read " . strlen($data) . " bytes");
> }
This is going to help
WOW...so much simpler..thank you very much!!
Cheers
Phil
style='FONT-SIZE:11px;FONT-FAMILY:tahoma,sans-serif'>size=1>
From: Burhan Khalid <[EMAIL PROTECTED]>To: Philippe
Reynolds <[EMAIL PROTECTED]>CC:
php-general@lists.php.netSubject: Re: [PHP] Socket
functio
Philippe Reynolds wrote:
Greetings,
When I do an ifconfig in unix, I see the the IP address for the my
ethernet. It follows something called inet.
Would anyone know who to manipulate the socket functions to be able to
extract the inet IP address fromt the eth0 section??
--
PHP General M
Hi
I suggest to use cron table against php deamon, It'will we be more stable
and using less load.
regards
- Original Message -
From: "Richard Lynch" <[EMAIL PROTECTED]>
To: "kioto" <[EMAIL PROTECTED]>
Cc: "php-general"
Sent: Friday,
On Wed, June 22, 2005 11:52 pm, kioto said:
> Hi all sorry for the ignorance :D.This is my first time with Socket and
> i have
> a question for you.I want create a script that run like daemon in
> background
> and listen incoming request.It's possible with socket open a stream to a
> directory
> an
OK, I found the error. Aparently, the message that I was sending didn't have a
newline at the end, and so socket_read on the other end failed to complete
it's task, and finds it self with a conection reset by pear when the client
tries to write something else.
I found out when looking at the Ne
El Vie 06 May 2005 01:50, Richard Lynch escribió:
> On Thu, May 5, 2005 5:20 am, Martín Marqués said:
> > I'm trying to build some communication aside of the server thin client
> > stuff,
> > with a socket daemon and a socket client.
> >
> > The daemon is the same that everybody can find in the PHP
On Thu, May 5, 2005 5:20 am, Martín Marqués said:
> I'm trying to build some communication aside of the server thin client
> stuff,
> with a socket daemon and a socket client.
>
> The daemon is the same that everybody can find in the PHP docs (example
> 1).
> The client simply opens a connection to
To prevent the blocking and your CPU going up to 100% usages look into:
http://us2.php.net/manual/en/function.socket-select.php
For length of a string:
http://us2.php.net/manual/en/function.strlen.php
- Original Message -
From: René Fournier <[EMAIL PROTECTED]>
Date: Thursday, October 28
Hi Andrew,
This one helped me a lot:
http://www.devshed.com/c/a/PHP/Socket-Programming-With-PHP/
This isn't a tutorial, but good sample code for a multi-client chat
server:
http://dave.dapond.com/socketselect.phps
...Rene
On Monday, July 5, 2004, at 12:39 PM, Andrew wrote:
Hi guys,
Can somebody p
* Thus wrote Ren Fournier ([EMAIL PROTECTED]):
>
> MESSAGE RECEIVED
> PHP Warning: socket_read() unable to read from socket [35]: Resource
> temporarily unavailable in /Users/rene/Sites/gpspolice/titan/cr.php on
> line 61
This error [35] will occur if the socket isn't ready yet. Its an EAGA
The script doesn't even get that first "while" condition line. It loops
a few times (while receiving messages), then when no more messages are
coming from the server, and it times-out, it breaks out of the "while",
then returns to the top again, where it that while condition returns
the error "
Hi,
Friday, May 14, 2004, 5:21:10 AM, you wrote:
RF> Hi all,
RF> Still encountering some challenges with my socket loop. Basically, I
RF> need this socket client to wait to read incoming data, but if nothing
RF> happens for more than three seconds, I want it to do something, then
RF> return to wa
On Fri, 7 May 2004 00:59:03 -0300 (ART)
"Juan Pablo Herrera" <[EMAIL PROTECTED]> wrote:
> Please, i need a tutorial about socket. I read php.net but the examples is
> lost.
I think you should check it again ;)
http://www.php.net/manual/en/ref.sockets.php
--
Petr U.
--
PHP General Mailing Li
[snip]
PHP Notice: Undefined variable: client in /Users/rene/Sites/test/s9.php on line 30
Here's my code:
[/snip]
I tried counting the lines, but could not determine which one was line 30. Is this
it...
if ($client[$i]['sock'] != null) $read[$i+1] = $client[$i]['sock'];
If so $client is not
On Tue, 2004-04-13 at 17:17, René Fournier wrote:
> Hi,
>
> I've gone through several good PHP sockets tutorials, but all of them
> seem to focused on making socket servers. What I actually need to do is
> write a socket client. There's an app runnning on a distant server that
> accepts incomin
http://www.google.com :-)
Hemp Cluster wrote:
Hy... @ all
I'm trying to find a better documentation about socket extension in php
as on php.net self.
does anyone know an another source for me ???
thx & regards
Jointy
--
Raditha Dissanayake.
-
Technical Services wrote:
I am trying to use a php include provided by a 3rd party. In the
include the code is trying to open a socket however I get the
following error:
errno 38 - Socket operation on non-socket
however if I check the server the file requested exists and is chmoded
777.
Does anyo
* Thus wrote Chris Shiflett ([EMAIL PROTECTED]):
>
> Disclaimer: Things listed as experimental should always be treated as such and
> never relied upon to have a consistent API or not break.
>
> That said, I recall that the current sockets extension maintainer desires to
> label the extension sta
--- Curt Zirzow <[EMAIL PROTECTED]> wrote:
> > On the other hand, I've found a lot of tutorials extolling PHP's
> > socket functions, and since I know PHP a bit now I would rather
> > use it for my TCP socket application than learn C and implement
> > it there.
> >
> > What do you think?
>
> if y
* Thus wrote René Fournier ([EMAIL PROTECTED]):
> I've noticed in the PHP docs "EXPERIMENTAL" is marked over all the
> socket functions. Would it be risky to develop a PHP socket app using
> those functions? It seems they could change with the next release and
> my app would instantly stop worki
Hello,
This is a reply to an e-mail that you wrote on Wed, 16 Jul 2003 at 01:34,
lines prefixed by '>' were originally written by you.
> I've already opened opened port for
> this as
> what David said but i cant see the output in the web.
> He'res what i've did in my Redhat linux 6.x
> Am I in a
I'm afraid I don't know the answer to your question, Mike, but you may want
to check out this month's php|architect. I just started reading through it
and the cover story is about socket programming:
http://www.phparchitect.com/
Hope this helps, -Step
> Hi to all,
>
> Is it possible to run php i
Hello,
This is a reply to an e-mail that you wrote on Tue, 15 Jul 2003 at 09:33,
lines prefixed by '>' were originally written by you.
> Hi to all,
> Is it possible to run php in the web running in a specified port
> without
> installing apache in Linux?
> Can anyone give a sample code for this? I
I'm pretty sure its not in an endless loop and php is 4.3, im still nowhere
closer to fixing this.
I'm sure its not hardware and I thought I was sure its not networkl related
but I think im going to have to rethirnk my ideas.
Cheers.
Chris
"Fejes Jozsef" <[EMAIL PROTECTED]> wrote in message
new
> "The script started from the URL '/myscript/index.php' with parameters ''
> has not responded within the configured timeout period. The HTTP server is
> terminating the script."
maybe the problem is not with the sockets but you have an endless loop bug?
do you have an up-to-date version of php?
did u turn mysql on?
end of mysql installation output:
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
This is done with:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h
CPE00022af118a5-CM024330008757.cpe.net.cable.rogers.com password
'new-passwo
, please notify us by return
email and permanently
delete the document.
~~~
- Original Message -
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 04, 2003 6:1
On Friday 21 February 2003 15:49, Bryan Lipscy wrote:
> $db= @mysql_pconnect ( $DB_HOST , $DB_USER , $DB_PASS );
> @mysql_select_db ( $DB_DB ) or die ( "DATABASE ERROR!".mysql_error() );
>
> Returns DATABASE ERROR!Can't connect to local MySQL server through
> socket '/tmp/mysql.sock' (2)
>
> MySQL
--- Gareth Thomas <[EMAIL PROTECTED]> wrote:
> I am attempting to timeout a socket_read() that is part
> of a handshaking process using socket_set_timeout().
> Problem is it doesn't seem to work at all. If I switch of
> the handshaking write on the server side the read just
> sits there and doesn't
If the remote system has the finger service activated, that would work.
However, most servers have stopped running this and also the user generally
has a say in whether they want to be listed.
Out of curiosity, why do you want to do this?
Mike Frazer
"Bvr" <[EMAIL PROTECTED]> wrote in message
Yes, this is possible.
However you would need to connect to the users mailserver instead of just the domain.
Use getmxrr() to retrieve the mail exchanger associated with the domain.
To check if the user is accepted on that server you can issue a RCPT TO: command
on it and see what happens.
A
-Sterling
> /sagar
>
> - Original Message -
> From: Sterling Hughes <[EMAIL PROTECTED]>
> To: sagar <[EMAIL PROTECTED]>
> Cc: php <[EMAIL PROTECTED]>
> Sent: Saturday, September 08, 2001 1:54 AM
> Subject: Re: [PHP] socket error
>
>
> >
thanX sterling,
i've changed it to socket_open() but the problem
still exists.
/sagar
- Original Message -
From: Sterling Hughes <[EMAIL PROTECTED]>
To: sagar <[EMAIL PROTECTED]>
Cc: php <[EMAIL PROTECTED]>
Sent: Saturday, September 08, 2001 1:54 AM
Subject:
On Sat, 8 Sep 2001, sagar wrote:
> line10 -> if (($sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
> echo "socket() failed: reason: " . strerror($sock) . "\n";
> }
>
> i'm getting an error saying
> Fatal error: Call to undefined function: socket() in c:\program file
many thanks.
i settled for fgetc and checking for a NULL (ascii 0)
Steve
> -Original Message-
> From: David George [mailto:[EMAIL PROTECTED]]
> Sent: 05 July 2001 21:50
> To: Justin Farnsworth
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Socket Madness
>
&
Justin Farnsworth wrote:
>Steve Brett wrote:
>
>>does anyone know the ascii value for EOF ?
>>
>
>I think it is four (CTRL-D), viz:
>
>| 00 nul| 01 soh| 02 stx| 03 etx| 04 eot| 05 enq| 06 ack| 07 bel|
>
Actually EOT is not EOF. There is no such ASCII character as EOF. It
is a condition not a c
Steve Brett wrote:
>
> fixed it now by adding ascii(10) to reply from server BUT what if i use
> fgetc ?
>
> does anyone know the ascii value for EOF ?
>
> cheers,
>
> Steve
I think it is four (CTRL-D), viz:
| 00 nul| 01 soh| 02 stx| 03 etx| 04 eot| 05 enq| 06 ack| 07 bel|
| 08 bs | 09 ht |
fixed it now by adding ascii(10) to reply from server BUT what if i use
fgetc ?
does anyone know the ascii value for EOF ?
cheers,
Steve
> -Original Message-
> From: Steve Brett [mailto:[EMAIL PROTECTED]]
> Sent: 05 July 2001 12:58
> To: Php-General (E-mail)
> Subject: [PHP] Socket Mad
Yasuo Ohgaki wrote:
> Did you read the Manual?
The manual is my bible I always read it before I post. Also searched
google and the list archives.
> socket_set_blocking
As far as I can tell this does not work for the new socket functions,
the file descriptor does not seem to be compatible? (i
Did you read the Manual?
>From PHP Manual
=
socket_set_blocking
Description
int socket_set_blocking (int socket descriptor, int mode)
If mode is false, the given socket descriptor will be switched to non-blocking
mode, and if true, it will be switched to blocking mode. This affects call
Joseph Blythe wrote:
> hello,
>
> does anyone know if set_nonblock() works, what paramaters it takes
> and what it returns?
>
> there is only one mention of it in the manual under accept_connect,
> and I can not seem to set the socket to non block??
>
> also has anybody successfully wri
83 matches
Mail list logo