TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   General (http://www.talkphp.com/general/)
-   -   Unable to find the socket transport "UDP" - did you forget to enable it when you con (http://www.talkphp.com/general/2464-unable-find-socket-transport-udp-did-you-forget-enable-when-you-con.html)

Orc 03-12-2008 12:56 PM

Unable to find the socket transport "UDP" - did you forget to enable it when you con
 
Or HTTP, and a bunch of different stream transports. Look, I need to grab some information, I know cUrl is an alternative, but I jsut want to do this.

PHP Code:

Unable to find the socket transport "HTTP" did you forget to enable it when you configured PHP?) 

My error,
My code:
PHP Code:

$ip "UDP://127.0.0.1"// I know this is my local ip, but I dont want you to know what it is!
$port "80"// I changed this aswell
$fp fsockopen($ip,$port);
$read stream_get_meta_data($f); // tried socket_get_status //aswell
if ($read['unread_bytes']!=0)
{
    while(!
feof($fp))
    {
    
print_r($read);
    }


By the way, I already know sometimes you need openSSL, I already have that checked in my wamp config.

I just tried ssl, but now it just gives me that
PHP Code:

Maximum execution time of 30 seconds exceeded 

Update: I tried it without a protocol, now its just blank

Alan @ CIT 03-12-2008 01:18 PM

Your error message is talking about HTTP but your code is using UDP so I'm going to assume you are using UDP :-)

To fix that error, just use lowercase udp:// -

PHP Code:

$ip "udp://127.0.0.1"

Alan

Orc 03-12-2008 01:21 PM

Quote:

Originally Posted by Alan @ CIT (Post 12308)
Your error message is talking about HTTP but your code is using UDP so I'm going to assume you are using UDP :-)

To fix that error, just use lowercase udp:// -

PHP Code:

$ip "udp://127.0.0.1"

Alan

When I do that it gives me
PHP Code:

Array ( [stream_type] => udp_socket [mode] => r+ [unread_bytes] => [seekable] => [timed_out] => [blocked] => [eof] => ) 

I mean the ip and port is valid, what am I doing wrong?

Alan @ CIT 03-12-2008 01:26 PM

In your original code you have:

PHP Code:

$read stream_get_meta_data($f); 

Should this be $fp instead of $f or is $f defined elsewhere?

Alan

Orc 03-12-2008 01:27 PM

Quote:

Originally Posted by Alan @ CIT (Post 12311)
In your original code you have:

PHP Code:

$read stream_get_meta_data($f); 

Should this be $fp instead of $f or is $f defined elsewhere?

Alan

Already fixed that. Still does it.


All times are GMT. The time now is 11:03 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0