Skip to content

Commit 1c11809

Browse files
committed
added sleep in main
1 parent 3dd136e commit 1c11809

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

__pycache__/config.cpython-36.pyc

312 Bytes
Binary file not shown.

server.py

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import threading
33
import os
44
import config
5+
import time
56

67
# set directory for file server
78
root = "Root/"
@@ -132,29 +133,33 @@ def main():
132133
thread_listen_server.daemon = True
133134
thread_listen_server.start()
134135

135-
# SERVER A
136-
server_socket.connect(
137-
(config.SERVER_B_CONFIG['host'], config.SERVER_B_CONFIG['port']))
138-
server_socket.connect(
139-
(config.SERVER_C_CONFIG['host'], config.SERVER_C_CONFIG['port']))
136+
# # SERVER A
137+
# server_socket.connect(
138+
# (config.SERVER_B_CONFIG['host'], config.SERVER_B_CONFIG['port']))
139+
# server_socket.connect(
140+
# (config.SERVER_C_CONFIG['host'], config.SERVER_C_CONFIG['port']))
140141

141-
# SERVER B
142-
server_socket.connect(
143-
(config.SERVER_A_CONFIG['host'], config.SERVER_A_CONFIG['port']))
144-
server_socket.connect(
145-
(config.SERVER_C_CONFIG['host'], config.SERVER_C_CONFIG['port']))
142+
# # SERVER B
143+
# server_socket.connect(
144+
# (config.SERVER_A_CONFIG['host'], config.SERVER_A_CONFIG['port']))
145+
# server_socket.connect(
146+
# (config.SERVER_C_CONFIG['host'], config.SERVER_C_CONFIG['port']))
146147

147-
# SERVER C
148-
server_socket.connect(
149-
(config.SERVER_A_CONFIG['host'], config.SERVER_B_CONFIG['port']))
150-
server_socket.connect(
151-
(config.SERVER_B_CONFIG['host'], config.SERVER_B_CONFIG['port']))
148+
# # SERVER C
149+
# server_socket.connect(
150+
# (config.SERVER_A_CONFIG['host'], config.SERVER_B_CONFIG['port']))
151+
# server_socket.connect(
152+
# (config.SERVER_B_CONFIG['host'], config.SERVER_B_CONFIG['port']))
152153

153154
thread_listen_client = threading.Thread(
154155
target=listen_client, kwargs={"clientsocket": client_socket}
155156
)
156157
thread_listen_client.daemon = True
157158
thread_listen_client.start()
158159

160+
while True:
161+
time.sleep(5)
162+
print("server is awake")
163+
159164

160165
main()

0 commit comments

Comments
 (0)