-
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
Showing
4 changed files
with
88 additions
and
1 deletion.
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,33 @@ | ||
Client side | ||
----------- | ||
|
||
.. py:data:: connect | ||
Fired when the client connects to the server. | ||
|
||
Returns: ``None`` | ||
|
||
.. py:data:: disconnect | ||
Fired when the client disconnects from the server. | ||
|
||
Returns: ``None`` | ||
|
||
.. py:data:: message | ||
Fired when the server emits an event to the client. | ||
|
||
Returns a ``tuple`` of: | ||
|
||
* ``event``: The name of the emitted event. | ||
* ``data``: The data emitted by the server. | ||
|
||
.. py:data:: error | ||
Fired when an uncaught exception occurs in the client. | ||
If you don't handle this event, the client will raise the exception. | ||
|
||
Returns: | ||
|
||
* ``error``: The exception message. |
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,15 @@ | ||
Default events | ||
========================== | ||
|
||
Some connection-related events are fired by default. You can handle them by adding a listener with the ``.on()`` method, just like any other event. | ||
|
||
|
||
.. toctree:: | ||
|
||
default_server | ||
default_client | ||
|
||
Learn more | ||
---------- | ||
|
||
- :doc:`Library references <../references/index>` |
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,38 @@ | ||
Server side | ||
----------- | ||
The following events are fired by default on the server side: | ||
|
||
|
||
.. py:data:: connection | ||
Fired when a client connects to the server. | ||
|
||
Returns: | ||
|
||
* ``client_id``: The new client's socket UUID. | ||
|
||
.. py:data:: disconnect | ||
Fired when a client disconnects from the server. | ||
|
||
Returns: | ||
|
||
* ``client_id``: The client's socket UUID. | ||
|
||
.. py:data:: message | ||
Fired when a client emits an event to the server. | ||
|
||
Returns a ``tuple`` of: | ||
|
||
* ``event``: The name of the emitted event. | ||
* ``data``: The data emitted by the client. | ||
|
||
.. py:data:: error | ||
Fired when an uncaught exception occurs in the server. | ||
If you don't handle this event, the server will raise the exception. | ||
|
||
Returns: | ||
|
||
* ``error``: The exception message. |
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