Documentation for Communications Module¶
CommunicationsManager
¶
Singleton class responsible for managing all communications in the Nebula system.
This class handles: - Sending and receiving protobuf messages between nodes. - Forwarding messages when acting as a proxy. - Managing known neighbors and communication topology. - Handling and dispatching incoming messages to the appropriate handlers. - Preventing message duplication via message hash tracking.
It acts as a central coordinator for message-based interactions and is designed to work asynchronously to support non-blocking network operations.
Source code in nebula/core/network/communications.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 |
|
bl
property
¶
Returns the blacklist manager, used to track and filter banned or disconnected nodes.
connections
property
¶
Returns the current list of active connections to neighboring nodes.
discoverer
property
¶
Returns the component responsible for discovering new nodes in the network.
ecs
property
¶
Returns the ExternalConnectionService for handling external network interactions.
engine
property
¶
Returns the main engine responsible for coordinating local training and aggregation.
forwarder
property
¶
Returns the message forwarder, responsible for forwarding messages to other nodes.
health
property
¶
Returns the HealthMonitor component that checks and maintains node health status.
mm
property
¶
Returns the MessagesManager instance, used to create and process protocol messages.
propagator
property
¶
Returns the component responsible for propagating messages throughout the network.
add_to_blacklist(addr)
async
¶
Adds the given address to the blacklist, preventing any future connection attempts.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
addr
|
str
|
The address of the node to blacklist. |
required |
Source code in nebula/core/network/communications.py
313 314 315 316 317 318 319 320 |
|
add_to_recently_disconnected(addr)
async
¶
Adds the given address to the list of recently disconnected nodes.
This is typically used for temporary disconnection tracking before reattempting communication.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
addr
|
str
|
The address of the node to mark as recently disconnected. |
required |
Source code in nebula/core/network/communications.py
302 303 304 305 306 307 308 309 310 311 |
|
apply_restrictions(nodes)
async
¶
Filters a set of node addresses by removing any that are restricted (e.g., blacklisted).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nodes
|
set
|
A set of node addresses to filter. |
required |
Returns:
Type | Description |
---|---|
set | None
|
set or None: A filtered set of addresses, or None if all were restricted. |
Source code in nebula/core/network/communications.py
331 332 333 334 335 336 337 338 339 340 341 |
|
clear_restrictions()
async
¶
Clears all temporary and permanent restrictions, including the blacklist and recently disconnected nodes.
Source code in nebula/core/network/communications.py
343 344 345 346 347 |
|
clear_unused_undirect_connections()
async
¶
Cleans up inactive undirected connections.
Iterates over the current connections, identifies those marked as inactive, and asynchronously disconnects them without requiring mutual disconnection.
Source code in nebula/core/network/communications.py
749 750 751 752 753 754 755 756 757 758 759 760 |
|
connect(addr, direct=True, priority='medium')
async
¶
Public method to initiate or upgrade a connection to a neighbor. Checks for existing connections,
avoids duplicates, and delegates the actual establishment logic to establish_connection
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
addr
|
str
|
The neighbor address in "host:port" format. |
required |
direct
|
bool
|
Whether the new connection should be direct. Defaults to True. |
True
|
priority
|
str
|
Priority level for establishing the connection. Defaults to "medium". |
'medium'
|
Returns:
Name | Type | Description |
---|---|---|
bool |
True if the connection action (new or upgrade) succeeded, False otherwise. |
Source code in nebula/core/network/communications.py
1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 |
|
create_message(message_type, action='', *args, **kwargs)
¶
Creates a new protocol message using the MessagesManager.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message_type
|
str
|
The type of message (e.g., 'model', 'discover'). |
required |
action
|
str
|
An optional action to associate with the message. |
''
|
*args
|
Positional arguments for the message. |
()
|
|
**kwargs
|
Keyword arguments for the message. |
{}
|
Returns:
Name | Type | Description |
---|---|---|
BaseMessage |
The constructed message object. |
Source code in nebula/core/network/communications.py
273 274 275 276 277 278 279 280 281 282 283 284 285 286 |
|
deploy_additional_services()
async
¶
Starts additional network-related services required for the communications manager.
This includes asynchronously starting the forwarder service and synchronously starting the propagator service, enabling message forwarding and propagation functionalities within the network.
Source code in nebula/core/network/communications.py
795 796 797 798 799 800 801 802 803 804 |
|
deploy_network_engine()
async
¶
Deploys and starts the network engine server that listens for incoming connections.
Creates an asyncio server and schedules it to serve connections indefinitely.
Source code in nebula/core/network/communications.py
516 517 518 519 520 521 522 523 524 525 |
|
disconnect(dest_addr, mutual_disconnection=True, forced=False)
async
¶
Disconnects from a specified destination address and performs cleanup tasks.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dest_addr
|
str
|
The address of the node to disconnect from. |
required |
mutual_disconnection
|
bool
|
Whether to notify the peer about the disconnection. Defaults to True. |
True
|
forced
|
bool
|
If True, the destination address will be blacklisted. Defaults to False. |
False
|
Source code in nebula/core/network/communications.py
1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 |
|
establish_connection(addr, direct=True, reconnect=False, priority='medium')
async
¶
Establishes a TCP connection to a remote node, handling blacklist checks, pending connection tracking, and bidirectional handshake logic. Optionally upgrades an existing connection to direct, enforces reconnection retries, and assigns a connection priority.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
addr
|
str
|
The target node address in "host:port" format. |
required |
direct
|
bool
|
Whether this connection should be marked as direct. Defaults to True. |
True
|
reconnect
|
bool
|
If True, enable reconnection tracking for this node. Defaults to False. |
False
|
priority
|
str
|
Priority level for this connection ("low", "medium", "high"). Defaults to "medium". |
'medium'
|
Returns:
Name | Type | Description |
---|---|---|
bool |
True if the connection action (new or upgrade) succeeded, False otherwise. |
Source code in nebula/core/network/communications.py
887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 |
|
forward_message(data, addr_from)
async
¶
Forwards a message to other nodes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
bytes
|
The message to be forwarded. |
required |
addr_from
|
str
|
The address of the sender. |
required |
Source code in nebula/core/network/communications.py
237 238 239 240 241 242 243 244 245 246 |
|
get_addr()
¶
Returns the network address (host:port) of this node.
Returns:
Name | Type | Description |
---|---|---|
str |
The node's own address. |
Source code in nebula/core/network/communications.py
489 490 491 492 493 494 495 496 |
|
get_addrs_current_connections(only_direct=False, only_undirected=False, myself=False)
async
¶
Get the addresses of current connections, optionally including self and filtering by connection type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
only_direct
|
bool
|
If True, include only directly connected addresses. Defaults to False. |
False
|
only_undirected
|
bool
|
If True, include only undirected connections. Defaults to False. |
False
|
myself
|
bool
|
If True, include this node's own address in the result. Defaults to False. |
False
|
Returns:
Name | Type | Description |
---|---|---|
set |
A set of connection addresses according to the specified filters. |
Source code in nebula/core/network/communications.py
1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 |
|
get_all_addrs_current_connections(only_direct=False, only_undirected=False)
async
¶
Retrieve the addresses of current connections with filtering options.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
only_direct
|
bool
|
If True, return only directly connected addresses. Defaults to False. |
False
|
only_undirected
|
bool
|
If True, return only undirected (non-direct) connections. Defaults to False. |
False
|
Returns:
Name | Type | Description |
---|---|---|
set |
A set of connection addresses based on the filtering criteria. |
Source code in nebula/core/network/communications.py
1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 |
|
get_blacklist()
async
¶
Retrieves the current set of blacklisted node addresses.
Returns:
Name | Type | Description |
---|---|---|
set |
A set of addresses currently in the blacklist. |
Source code in nebula/core/network/communications.py
322 323 324 325 326 327 328 329 |
|
get_config()
¶
Returns the configuration object associated with this communications manager.
Returns:
Name | Type | Description |
---|---|---|
Config |
The configuration instance containing settings and parameters. |
Source code in nebula/core/network/communications.py
480 481 482 483 484 485 486 487 |
|
get_connections_lock()
¶
Returns the asynchronous lock object used to synchronize access to the connections dictionary.
Returns:
Type | Description |
---|---|
asyncio.Lock: The lock protecting the connections data structure. |
Source code in nebula/core/network/communications.py
471 472 473 474 475 476 477 478 |
|
get_instance()
classmethod
¶
Obtain CommunicationsManager instance
Source code in nebula/core/network/communications.py
51 52 53 54 55 56 |
|
get_messages_events()
¶
Returns the mapping of message types to their respective events.
Returns:
Name | Type | Description |
---|---|---|
dict |
A dictionary of message event associations. |
Source code in nebula/core/network/communications.py
288 289 290 291 292 293 294 295 |
|
get_round()
async
¶
Retrieves the current training round number from the engine.
Returns:
Name | Type | Description |
---|---|---|
int |
The current round number in the federated learning process. |
Source code in nebula/core/network/communications.py
498 499 500 501 502 503 504 505 |
|
handle_connection(reader, writer, priority='medium')
async
¶
Wrapper coroutine to handle a new incoming connection.
Schedules the actual connection handling coroutine as an asyncio task.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
reader
|
StreamReader
|
Stream reader for the connection. |
required |
writer
|
StreamWriter
|
Stream writer for the connection. |
required |
Source code in nebula/core/network/communications.py
530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 |
|
handle_incoming_message(data, addr_from)
async
¶
Handles an incoming message if the sender is not blacklisted.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
bytes
|
The raw message data. |
required |
addr_from
|
str
|
The address of the sender. |
required |
Source code in nebula/core/network/communications.py
226 227 228 229 230 231 232 233 234 235 |
|
handle_message(message_event)
async
¶
Publishes a message event to the EventManager.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message_event
|
MessageEvent
|
The message event to publish. |
required |
Source code in nebula/core/network/communications.py
248 249 250 251 252 253 254 255 |
|
handle_model_message(source, message)
async
¶
Handles a model-related message and routes it as either initialization or update.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source
|
str
|
The sender's address. |
required |
message
|
BaseMessage
|
The model message containing the round and payload. |
required |
Source code in nebula/core/network/communications.py
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 |
|
include_received_message_hash(hash_message, source)
async
¶
Adds a received message hash to the tracking list if it hasn't been seen before.
This prevents processing the same message multiple times in the network.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
hash_message
|
str
|
The hash of the received message. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
True if the hash was added (i.e., the message is new), False if it was already received. |
Source code in nebula/core/network/communications.py
806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 |
|
init_external_connection_service()
async
¶
Initializes and starts the external connection service.
Source code in nebula/core/network/communications.py
372 373 374 375 376 |
|
is_external_connection_service_running()
async
¶
Checks if the external connection service is currently running.
Returns:
Name | Type | Description |
---|---|---|
bool |
True if the ECS is running, False otherwise. |
Source code in nebula/core/network/communications.py
378 379 380 381 382 383 384 385 |
|
modify_beacon_frequency(frequency)
async
¶
Modifies the frequency of the beacon emission.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
frequency
|
float
|
The new frequency (in seconds) between beacon emissions. |
required |
Source code in nebula/core/network/communications.py
399 400 401 402 403 404 405 406 |
|
send_message(dest_addr, message, message_type='')
async
¶
Sends a message to a specific destination address, with optional compression for large messages.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dest_addr
|
str
|
The destination address of the message. |
required |
message
|
Any
|
The message to send. |
required |
message_type
|
str
|
Type of message. If in _COMPRESSED_MESSAGES, it will be sent compressed. |
''
|
Source code in nebula/core/network/communications.py
857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 |
|
send_message_to_neighbors(message, neighbors=None, interval=0)
async
¶
Sends a message to all or specific neighbors.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
Any
|
The message to send. |
required |
neighbors
|
set
|
A set of neighbor addresses to send the message to. If None, the message is sent to all direct neighbors. |
None
|
interval
|
float
|
Delay in seconds between sending the message to each neighbor. |
0
|
Source code in nebula/core/network/communications.py
835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 |
|
stablish_connection_to_federation(msg_type='discover_join', addrs_known=None)
async
¶
Uses the ExternalConnectionService to discover and establish connections with other nodes in the federation.
This method performs the following steps:
1. Discovers nodes on the network (if addrs_known
is not provided).
2. Establishes TCP connections with discovered nodes.
3. Sends a federation discovery message to them.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
msg_type
|
str
|
The type of discovery message to send (e.g., 'discover_join' or 'discover_nodes'). |
'discover_join'
|
addrs_known
|
list
|
A list of known addresses to use instead of performing discovery. |
None
|
Returns:
Name | Type | Description |
---|---|---|
tuple |
tuple[int, set]
|
A tuple containing: - discovers_sent (int): Number of discovery messages sent. - connections_made (set): Set of addresses to which connections were successfully initiated. |
Source code in nebula/core/network/communications.py
408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 |
|
start()
async
¶
Starts the communications manager by deploying the network engine to accept incoming connections.
This initializes the server and begins listening on the configured host and port.
Source code in nebula/core/network/communications.py
507 508 509 510 511 512 513 514 |
|
start_beacon()
async
¶
Starts the beacon emission process to announce the node's presence on the network.
Source code in nebula/core/network/communications.py
387 388 389 390 391 |
|
start_communications(initial_neighbors)
async
¶
Starts the communication services and connects to initial neighbors.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
initial_neighbors
|
list
|
A list of neighbor addresses to connect to after startup. |
required |
Source code in nebula/core/network/communications.py
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
|
start_external_connection_service(run_service=True)
async
¶
Initializes and optionally starts the external connection service (ECS).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
run_service
|
bool
|
Whether to start the ECS immediately after initialization. Defaults to True. |
True
|
Source code in nebula/core/network/communications.py
354 355 356 357 358 359 360 361 362 363 364 |
|
stop_beacon()
async
¶
Stops the beacon emission process.
Source code in nebula/core/network/communications.py
393 394 395 396 397 |
|
stop_external_connection_service()
async
¶
Stops the external connection service if it is running.
Source code in nebula/core/network/communications.py
366 367 368 369 370 |
|
terminate_failed_reconnection(conn)
async
¶
Handles the termination of a failed reconnection attempt.
Marks the node as recently disconnected and closes the connection unilaterally (i.e., without requiring a mutual disconnection handshake).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
conn
|
Connection
|
The connection object representing the failed reconnection. |
required |
Source code in nebula/core/network/communications.py
682 683 684 685 686 687 688 689 690 691 692 693 694 |
|
verify_any_connections(neighbors)
async
¶
Checks if at least one of the given neighbors is currently connected.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
neighbors
|
iterable
|
A list or set of neighbor addresses to check. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
True if at least one neighbor is connected, False otherwise. |
Source code in nebula/core/network/communications.py
762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 |
|
verify_connections(neighbors)
async
¶
Checks if all given neighbors are currently connected.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
neighbors
|
iterable
|
A list or set of neighbor addresses to check. |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
True if all neighbors are connected, False otherwise. |
Source code in nebula/core/network/communications.py
778 779 780 781 782 783 784 785 786 787 788 789 790 |
|