Machines.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:kbe_server 作者: xiaohaoppy 项目源码 文件源码
def startServer(self, componentType, cid, gus, targetIP, trycount = 1, timeout = 1):
        """
        """
        msg = Define.BytesIO()
        msg.write( struct.pack("=H", MachineInterface_startserver ) ) # command
        msg.write( struct.pack("=H", struct.calcsize("=iiQhH") ) ) # command length
        msg.write( struct.pack("=i", self.uid) )
        msg.write( struct.pack("=i", componentType) )
        msg.write( struct.pack("=Q", cid) )
        msg.write( struct.pack("=h", gus) )
        msg.write( struct.pack("=H", socket.htons(self.replyPort)) ) # reply port

        if trycount <= 0:
            self.send( msg.getvalue(), targetIP )
            self.receiveReply()
        else:
            self.sendAndReceive( msg.getvalue(), targetIP, trycount, timeout )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号