class ServerThread(threading.Thread):
def __init__(self, num):
threading.Thread.__init__(self)
self._run_num = num
def run(self):
global connection,addr,Lock
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)
local_ip = get_local_ip()
#local_ip = "127.0.0.1"
s.bind((local_ip,9325))
s.listen(5)
DISPLAYSURF.blit(CREATESUCC_SURF, CREATESUCC_RECT)
pygame.display.update()
pygame.time.wait(1000)
DISPLAYSURF.blit(BOARDSURF,(BOARDLEFT ,BOARDTOP))
draw_board()
pygame.display.update()
#while True:
connection,addr = s.accept()
logger("creategame.txt","accept()")
DISPLAYSURF.blit(BEGINGAME_SURF, BEGINGAME_RECT)
pygame.display.update()
pygame.time.wait(2000)
Lock = False
print id(Lock)
def __init__(self, num):
threading.Thread.__init__(self)
self._run_num = num
def run(self):
global connection,addr,Lock
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)
local_ip = get_local_ip()
#local_ip = "127.0.0.1"
s.bind((local_ip,9325))
s.listen(5)
DISPLAYSURF.blit(CREATESUCC_SURF, CREATESUCC_RECT)
pygame.display.update()
pygame.time.wait(1000)
DISPLAYSURF.blit(BOARDSURF,(BOARDLEFT ,BOARDTOP))
draw_board()
pygame.display.update()
#while True:
connection,addr = s.accept()
logger("creategame.txt","accept()")
DISPLAYSURF.blit(BEGINGAME_SURF, BEGINGAME_RECT)
pygame.display.update()
pygame.time.wait(2000)
Lock = False
print id(Lock)