python3.7 socket通信
2020-12-13 03:47
标签:mod connect == dia des stream glob jin one 参考: https://blog.csdn.net/tianjing0517/article/details/84864917 https://www.cnblogs.com/wumingxiaoyao/p/7047658.html python3.7 socket通信 标签:mod connect == dia des stream glob jin one 原文地址:https://www.cnblogs.com/lqerio/p/11087406.html
def OpenClient(self,e):
global line
line = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
line.bind((HOST,PORT))
line.listen(3)
global conn,addr
conn,addr=line.accept()
‘‘‘
dlg = wx.MessageDialog(self,addr,"Connected",wx.OK)
dlg.ShowModal() #显示对话框
dlg.Destroy() #当结束之后关闭对话框
‘‘‘
data = conn.recv(1024)
data = data.decode()
...def OpenServer(self,e):
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
print(‘waiting ------->‘)
s.connect((HOST,PORT))
dlg = wx.MessageDialog(None, "connected with:"+HOST+"对方将控制你的机器", "Check", wx.YES_NO)
if dlg.ShowModal() == wx.ID_NO:
trigger = ‘0‘
s.sendall(trigger.encode())
...
上一篇:WIN2003配置多个网站