william-os4y / fapws3

Fast Asynchronous Python Web Server (based on libev)
GNU General Public License v2.0
341 stars 38 forks source link

add detection for port argument type #15

Closed sunng87 closed 14 years ago

sunng87 commented 14 years ago

I Know that fapws3 uses getaddrinfo internally which receives port as char*. However, most inetaddress api take port as an integer. To make the api of fapws3 portable enough, I suggest you to add a type detection on the port argument. If integer input detected, just convert it to string.

defnull commented 14 years ago

+1

Fapws3 broke backward compatibility very bad this time. The wrong type segfaults and there is no way to detect the expected type from within python.

In addition, please add a version attribute. The next time fapws3 breaks APIs we can at least special-case the release and work around such things.

william-os4y commented 14 years ago

until version 1.0, backward incompatibility could occurs. The switch to string was reported on the blog and mailing list.