bool TestExtStream::test_stream_get_meta_data() { int port = get_random_port(); string address = string("127.0.0.1:") + boost::lexical_cast<string>(port); Variant server = f_stream_socket_server(address); Variant client = f_stream_socket_client(address); f_stream_set_timeout(client, 0, 500 * 1000); // 500ms Variant line = f_fgets(client); Variant meta = f_stream_get_meta_data(client); VS(meta["timed_out"], true); VS(meta["blocked"], false); return Count(true); }
bool TestExtStream::test_stream_set_timeout() { Variant f = f_fopen("test/test_ext_file.txt", "r"); f_stream_set_timeout(f, 0); return Count(true); }
bool f_socket_set_timeout(CResRef stream, int seconds, int microseconds /* = 0 */) { return f_stream_set_timeout(stream, seconds, microseconds); }