php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59019 How can I just use 'udp' connect memcached
Submitted: 2010-01-04 03:39 UTC Modified: 2021-03-25 16:48 UTC
From: huaxingqian at gmail dot com Assigned: cmb (profile)
Status: Closed Package: memcache (PECL)
PHP Version: 5.2.6 OS: CentOS5.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
50 + 9 = ?
Subscribe to this entry?

 
 [2010-01-04 03:39 UTC] huaxingqian at gmail dot com
Description:
------------
memcache version 3.0.3 and memcached version 1.3.2.

How can I use UDP for 'set'.
How can I just use 'udp' connect memcached.

Reproduce code:
---------------
$memcache = new MemcachePool;
$memcache->connect('192.168.0.169', 0, 11223);
$mem_key = 'test_package';
$memcache->set($mem_key, 'sajkdghlghasldghsalghaslgh');
$re = $memcache->get($mem_key);
var_dump($re);

Expected result:
----------------
Warning: MemcachePool::connect() [memcachepool.connect]: Can't connect to 192.168.0.169:0, Failed to parse address "192.168.0.169" (0) in /data/local/apache2/htdocs/test.php on line 6
bool(false)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-03-14 02:07 UTC] hradtke@php.net
The fix for the connection is simple.  The problem is that there are assumptions in the code that rely on TCP connections.  Trying to use a UDP connection is completely unreliable.

I will leave this ticket open until all UDP issues are fixed.
 [2012-12-24 07:38 UTC] 38184788 at qq dot com
$b = new MemcachePool;
$startTime = microtime(true);

$b->connect("udp://127.0.0.1",16222);
$d = $b->get("testKey");

var_dump($d);
====================
the result is false 

and some error
SERVER_ERROR multi-packet request not supported

what problem?
 [2017-10-24 06:59 UTC] kalle@php.net
-Status: Assigned +Status: Open -Assigned To: hradtke +Assigned To:
 [2021-03-25 16:48 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2021-03-25 16:48 UTC] cmb@php.net
The official bug tracker for PECL/memcache is now at
<https://github.com/websupport-sk/pecl-memcache/issues>.

So, if this is still an issue with either of the current memcache
versions (4 or 8), please file an issue there.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 01:01:28 2024 UTC