bbc1.core.user_message_routing module¶
Copyright (c) 2017 beyond-blockchain.org.
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-
class
bbc1.core.user_message_routing.
UserMessageRouting
(networking, domain_id, loglevel='all', logname=None)[source]¶ Bases:
object
Handle message for clients
-
CROSS_REF_ASSIGNMENT
= b'\x00\x05'¶
-
JOIN_MULTICAST_RECEIVER
= b'\x00\x03'¶
-
LEAVE_MULTICAST_RECEIVER
= b'\x00\x04'¶
-
MAX_CROSS_REF_STOCK
= 10¶
-
REFRESH_FORWARDING_LIST_INTERVAL
= 300¶
-
RESOLVE_TIMEOUT
= 5¶
-
RESOLVE_USER_LOCATION
= b'\x00\x00'¶
-
RESPONSE_NO_SUCH_USER
= b'\x00\x02'¶
-
RESPONSE_USER_LOCATION
= b'\x00\x01'¶
-
register_user
(user_id, socket, on_multiple_nodes=False)[source]¶ Register user to forward message
Parameters: - user_id (bytes) – user_id of the client
- socket (Socket) – socket for the client
- on_multiple_nodes (bool) – If True, the user_id is also registered in other nodes, meaning multicasting.
-
send_message_to_user
(msg, direct_only=False)[source]¶ Forward message to connecting user
Parameters: - msg (dict) – message to send
- direct_only (bool) – If True, _forward_message_to_another_node is not called.
-
-
class
bbc1.core.user_message_routing.
UserMessageRoutingDummy
(networking, domain_id, loglevel='all', logname=None)[source]¶ Bases:
bbc1.core.user_message_routing.UserMessageRouting
Dummy class for bbc_core.py
-
register_user
(user_id, socket, on_multiple_nodes=False)[source]¶ Register user to forward message
Parameters: - user_id (bytes) – user_id of the client
- socket (Socket) – socket for the client
- on_multiple_nodes (bool) – If True, the user_id is also registered in other nodes, meaning multicasting.
-