[pypy-svn] r33361 - in pypy/dist/pypy: module/_socket rpython/rctypes/socketmodule
arigo at codespeak.net
arigo at codespeak.net
Tue Oct 17 12:24:36 CEST 2006
Author: arigo
Date: Tue Oct 17 12:24:33 2006
New Revision: 33361
Modified:
pypy/dist/pypy/module/_socket/rsocket.py
pypy/dist/pypy/rpython/rctypes/socketmodule/ctypes_socket.py
Log:
List the known missing bits of rsocket.py.
Modified: pypy/dist/pypy/module/_socket/rsocket.py
==============================================================================
--- pypy/dist/pypy/module/_socket/rsocket.py (original)
+++ pypy/dist/pypy/module/_socket/rsocket.py Tue Oct 17 12:24:33 2006
@@ -4,7 +4,15 @@
a drop-in replacement for the 'socket' module.
"""
-# ------------ IN - PROGRESS -----------
+# Known missing features:
+#
+# - support for non-Linux platforms
+# - address families other than AF_INET, AF_INET6, AF_UNIX
+# - methods getsockopt(), setsockopt(), makefile(), gettimeout(), settimeout()
+# - functions gethostbyaddr(), gethostbyname_ex(), getnameinfo(),
+# getprotobyname(), getservbyname(), getservbyport(),
+# getdefaulttimeout(), setdefaulttimeout()
+# - SSL
from pypy.rpython.objectmodel import instantiate
from pypy.rpython.rctypes.socketmodule import ctypes_socket as _c # MOVE ME
@@ -582,8 +590,9 @@
return buf.value
def gethostbyname(name):
- # XXX this works with IPv6 too, but the docs say it shouldn't...
- return makeipaddr(name)
+ # this is explicitly not working with IPv6, because the docs say it
+ # should not. Just use makeipaddr(name) for an IPv6-friendly version...
+ return makeipaddr(name, INETAddress())
def getaddrinfo(host, port_or_service,
family=_c.AF_UNSPEC, socktype=0, proto=0, flags=0):
Modified: pypy/dist/pypy/rpython/rctypes/socketmodule/ctypes_socket.py
==============================================================================
--- pypy/dist/pypy/rpython/rctypes/socketmodule/ctypes_socket.py (original)
+++ pypy/dist/pypy/rpython/rctypes/socketmodule/ctypes_socket.py Tue Oct 17 12:24:33 2006
@@ -289,6 +289,14 @@
inet_ntoa.argtypes = [in_addr]
inet_ntoa.restype = c_char_p
+inet_pton = socketdll.inet_pton
+inet_pton.argtypes = [c_int, c_char_p, sockaddr_ptr]
+inet_pton.restype = c_int
+
+inet_ntop = socketdll.inet_ntop
+inet_ntop.argtypes = [c_int, sockaddr_ptr, c_char_p, socklen_t]
+inet_ntop.restype = c_char_p
+
socketaccept = socketdll.accept
socketaccept.argtypes = [c_int, sockaddr_ptr, POINTER(socklen_t)]
socketaccept.restype = c_int
More information about the Pypy-commit
mailing list