-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
贠王军
committed
Oct 26, 2018
1 parent
088341a
commit 6b56317
Showing
3 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/vendor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "yunwangjun/talkart_socket", | ||
"description": "use workman design a socket service", | ||
"require": { | ||
"workerman/gateway-worker": ">=3.0.0", | ||
"workerman/mysql": "^1.0" | ||
}, | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "贠王军", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"require": {}, | ||
"autoload": { | ||
"psr-4": { | ||
"TalkArtSocket\\": "src/" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
/** | ||
* This file is part of talkart_socket. | ||
* | ||
* Licensed under The MIT License | ||
* For full copyright and license information, please see the MIT-LICENSE.txt | ||
* Redistributions of files must retain the above copyright notice. | ||
* | ||
* @author 贠王军<[email protected]> | ||
* @copyright 贠王军<[email protected]> | ||
* @link http://www.yunwangjun.cn/ | ||
* @license http://www.opensource.org/licenses/mit-license.php MIT License | ||
*/ | ||
|
||
namespace TalkArtSocket; | ||
/** | ||
* Autoload. | ||
*/ | ||
class SocketEvent{ | ||
|
||
public static function publush(){ | ||
|
||
echo date(); | ||
} | ||
|
||
public static function notice($subject, $event, $data, $exclude){ | ||
|
||
foreach ($subject_connnection_map[$subject] as $connection) { | ||
if ($exclude == $connection) { | ||
continue; | ||
} | ||
$connection->send(json_encode(array( | ||
'cmd' => 'publish', | ||
'event' => $event, | ||
'data' => $data | ||
))); | ||
} | ||
} | ||
} |