本文由我司收集整编,推荐下载,如有疑问,请与我司联系python的套接字。错误:[Errno 9]错误的文件描述符。
python的套接字。错误:[Errno 9]错误的文件描述符。[英]: [Errno 9] Bad file descriptor I wanted to make a server and a client with Python. It was supposed to make multiple connections, one, where the server is sending something to the client, and one where the client is sending something to the server.
 我想用Python做一个服务器和一个客户端。它应该创建多个连接,其中一个是服务器向客户端发送一些东西,另一个是客户端向服务器发送一些东西。properties是什么文件
localtime中文是什么  The first connection worked fine, but the second one crashed with the message:
json文件编辑器下载 第一个连接运行良好,但是第二个连接崩溃了:
weblogic常用端口  : [Errno 9] Bad file descriptor Here is the Server:drupal7 getshell
 这是服务器:
important意思
 import socketimport errnoimport pickledef Main(): host = ‘188.174.233.99’ port = 66666 all_text = [‘te
xt1’, ‘text2’, ‘text3’] all_description = [‘Test \n Description1\n’, ‘Test \n Description1\n’, ‘Test \n Description1\n’] all_images = [‘unlock.png’, ‘unlock.png’, ‘unlock.png’] s = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP) s.bind((host, port)) s.listen(1) if command == ‘GIVEALL’: textstring = pickle.dumps([all_text, all_images, all_description])#verwandelt Liste in String c.send(textstring)from kivy.properties import StringPropertyfrom kivy.properties import NumericPropertyfrom kivy.properties import ListPropertyclass Netclient(object): def __init__(self): self.s = socket.socket() = [] self.current = ‘All’ self.ip = ‘188.174.233.99’ self.port = 66666 def giveWid(self): print ‘give Widgets executed’ if self.current == ‘All’: , self.images, self.description = self.sentHOT(self.ip, self.port) , self.images, self.description def sentHOT(self, host, port): t((host, port)) self.s.send(‘GIVEALL’)#sends command recived_string = v(1023) more_text = pickle.loads(recived_string)#verwandelt string in liste self.s.close() print ‘closed’ return more_text[0], more_text[1], more_text[2] def

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。