fix compilation warning
fix signed/unsigned mismatch warning
use php_socket_t instead of int
int to size_t where the underlaying API supports it