コード例 #1
0
ファイル: ext_stream.cpp プロジェクト: KWMalik/hiphop-php
bool f_stream_set_timeout(CObjRef stream, int seconds,
                          int microseconds /* = 0 */) {
  if (stream.getTyped<Socket>(false, true)) {
    return f_socket_set_option
      (stream, SOL_SOCKET, SO_RCVTIMEO,
       CREATE_MAP2("sec", seconds, "usec", microseconds));
  }
  return false;
}
コード例 #2
0
ファイル: ext_stream.cpp プロジェクト: 2bj/hhvm
bool f_stream_set_timeout(const Resource& stream, int seconds,
                          int microseconds /* = 0 */) {
  if (stream.getTyped<Socket>(false, true)) {
    return f_socket_set_option
      (stream, SOL_SOCKET, SO_RCVTIMEO,
       make_map_array(s_sec, seconds, s_usec, microseconds));
  }
  return false;
}