Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Distributed-Systems
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Katharina Willig
Distributed-Systems
Commits
f5cc6067
Commit
f5cc6067
authored
4 months ago
by
Luca Randazzo
Browse files
Options
Downloads
Patches
Plain Diff
Update 2025-01-10_Server_V6.py
parent
6a5999b2
No related branches found
No related tags found
1 merge request
!1
Feat/finalfinal
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
2025-01-10_Server_V6.py
+2
-2
2 additions, 2 deletions
2025-01-10_Server_V6.py
with
2 additions
and
2 deletions
2025-01-10_Server_V6.py
+
2
−
2
View file @
f5cc6067
...
...
@@ -198,9 +198,9 @@ def new_server_in_ring():
msg
=
json
.
dumps
(
members_IP
).
encode
()
# If the server already exists, send the updated member list
else
:
members_IP
.
append
(
new_IP
)
# If the server is new, add its IP to the list
msg
=
f
"
There are already servers. I am your leader:
{
ip_address
}
"
# Create a message for the new server
msg
=
f
"
There are already servers. I am your leader:
{
ip_address
}
"
.
encode
()
# Create a message for the new server
#AttributeError: 'bytes' object has no attribute 'encode'. Did you mean: 'decode'?
sock
.
sendto
(
msg
.
encode
()
,
(
new_IP
,
new_server_port
))
# Send the greeting message back to the new server
sock
.
sendto
(
msg
,
(
new_IP
,
new_server_port
))
# Send the greeting message back to the new server
print
(
f
"
The updated IP_Ring is:
{
members_IP
}
"
)
send_update_to_ring
()
# Update the ring topology
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment