#ifndef _Socket_h
#define _Socket_h

BOOL
M(Socket,GetAddrInfo)(HTLIB* o,
					  const char* host, const char* service,
					  const struct addrinfo* hints,
					  struct addrinfo** info, HTLIB_ERROR* err);
void
M(Socket,FreeAddrInfo)(HTLIB* o, struct addrinfo* info);
BOOL
M(Socket,Connect)(HTLIB* o,
				  const struct sockaddr* addr, socklen_t len,
				  HTLIB_ERROR* err);

BOOL
M(Socket,Open)(HTLIB* o,int domain, int type, int protocol, HTLIB_ERROR* err);

void
M(Socket,Close)(HTLIB* o);

BOOL
M(Socket,Write)(HTLIB* o, const char* data, int len, HTLIB_ERROR* err);

int
M(Socket,Read)(HTLIB* o, char* buffer, int buffer_len, HTLIB_ERROR* err);


BOOL
M(Socket,Wait)(HTLIB* o, int timeout_millis,
			   BOOL
			   (*checkCanceled)(HTLIB* o, HTLIB_ERROR* err),
			   HTLIB_ERROR* err);


#endif
