20 #include <ndb_global.h>
22 #include "InputStream.hpp"
23 #include <socket_io.h>
27 FileInputStream::FileInputStream(FILE *
file)
32 FileInputStream::gets(
char *
buf,
int bufLen){
34 return fgets(buf, bufLen, f);
39 SocketInputStream::SocketInputStream(NDB_SOCKET_TYPE socket,
40 unsigned read_timeout_ms)
43 m_timeout_remain= m_timeout_ms = read_timeout_ms;
49 SocketInputStream::gets(
char * buf,
int bufLen) {
63 int res = readln_socket(m_socket, m_timeout_remain, &time,
64 buf+offset, bufLen-offset, m_mutex);
67 m_timeout_remain-=time;
68 if(res == 0 || m_timeout_remain<=0)