pjf_testcase_server.py 文件源码

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

项目:PyJFuzz 作者: mseclab 项目源码 文件源码
def send_testcase(json, ip, port):
        """
        Send a raw testcase
        """
        try:
            json = struct.pack("<I", len(json)) + json
            try:
                s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
                s.connect((ip, int(port)))
                s.send(json)
                s.shutdown(socket.SHUT_RDWR)
                s.close()
                return True
            except socket.error:
                return False
        except socket.error as e:
            raise PJFSocketError(e.message if hasattr(e, "message") else str(e))
        except Exception as e:
            raise  PJFBaseException(e.message)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号