no message
commit
e5c7ac8b77
@ -0,0 +1,5 @@
|
|||||||
|
/vendor
|
||||||
|
composer.lock
|
||||||
|
/.idea
|
||||||
|
/.vscode
|
||||||
|
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
The MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2009-2015 walkor<walkor@workerman.net> and contributors (see https://github.com/walkor/workerman/contributors)
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
@ -0,0 +1,35 @@
|
|||||||
|
GatewayClient
|
||||||
|
=================
|
||||||
|
`composer require workerman/gatewayclient`
|
||||||
|
|
||||||
|
```php
|
||||||
|
use GatewayClient\Gateway;
|
||||||
|
|
||||||
|
Gateway::$registerAddress = '127.0.0.1:3238';
|
||||||
|
|
||||||
|
Gateway::bindUid($client_id, $uid);
|
||||||
|
Gateway::joinGroup($client_id, $group_id);
|
||||||
|
|
||||||
|
Gateway::sendToUid($uid, $message);
|
||||||
|
Gateway::sendToGroup($group, $message);
|
||||||
|
|
||||||
|
Gateway::sendToAll($data);
|
||||||
|
Gateway::sendToClient($client_id, $data);
|
||||||
|
Gateway::closeClient($client_id);
|
||||||
|
Gateway::isOnline($client_id);
|
||||||
|
Gateway::bindUid($client_id, $uid);
|
||||||
|
Gateway::isUidOnline($uid);
|
||||||
|
Gateway::getClientIdByUid($uid);
|
||||||
|
Gateway::unbindUid($client_id, $uid);
|
||||||
|
Gateway::sendToUid($uid, $data);
|
||||||
|
Gateway::joinGroup($client_id, $group);
|
||||||
|
Gateway::sendToGroup($group, $data);
|
||||||
|
Gateway::leaveGroup($client_id, $group);
|
||||||
|
Gateway::getClientCountByGroup($group);
|
||||||
|
Gateway::getClientSessionsByGroup($group);
|
||||||
|
Gateway::getAllClientCount();
|
||||||
|
Gateway::getAllClientSessions();
|
||||||
|
Gateway::setSession($client_id, $session);
|
||||||
|
Gateway::updateSession($client_id, $session);
|
||||||
|
Gateway::getSession($client_id);
|
||||||
|
```
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"name" : "workerman/gateway-worker-demo",
|
||||||
|
"keywords": ["distributed","communication"],
|
||||||
|
"homepage": "http://www.workerman.net",
|
||||||
|
"license" : "MIT",
|
||||||
|
"require": {
|
||||||
|
"workerman/gateway-worker" : ">=3.0.0"
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"" : "./",
|
||||||
|
"" : "./Applications/YourApp/"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
<?php
|
||||||
|
$config = [
|
||||||
|
'name' => '鹿和开发套件', // 服务名称
|
||||||
|
'port' => 3282, // 服务端口
|
||||||
|
'register' => 3238, // 服务注册端口
|
||||||
|
'start' => 3900, // 内部通讯起始端口
|
||||||
|
];
|
||||||
Loading…
Reference in New Issue