Made bare bone server that runs. Looking to add proper login and logout functions that users will use to connect and disconnect with the server.
This commit is contained in:
parent
2e47014923
commit
9a4225751a
37
src/py-cli/make_sockets.py
Executable file
37
src/py-cli/make_sockets.py
Executable file
|
@ -0,0 +1,37 @@
|
|||
"""
|
||||
A file that makes a bunch of sockets
|
||||
|
||||
@author Lachezar Todorov
|
||||
"""
|
||||
|
||||
class WebSockestServerExternal():
|
||||
|
||||
def __init__(self):
|
||||
self.wsl = [10]
|
||||
self.count = 0
|
||||
|
||||
|
||||
#start session
|
||||
def login(self, name):
|
||||
self.wsl[self.count] = name
|
||||
self.count += 1
|
||||
self.printing()
|
||||
|
||||
#exit session
|
||||
def logout(self, name):
|
||||
for name in self.wsl:
|
||||
if name == name:
|
||||
index = self.wsl.index(name)
|
||||
self.wsl[index] = ""
|
||||
self.printing()
|
||||
|
||||
#print out the list
|
||||
def printing(self):
|
||||
for name in self.wsl:
|
||||
print(name)
|
||||
|
||||
WebSockestServerExternal()
|
||||
|
||||
#alice.login()
|
||||
#alice.logout()
|
||||
|
Loading…
Reference in New Issue
Block a user