eAbort
}eNextState;
-typedef int (*EventContextAttach)(void *Data);
-typedef eNextState (*IO_CallBack)(void *Data);
+typedef eNextState (*IO_CallBack)(AsyncIO *IO);
typedef eReadState (*IO_LineReaderCallback)(AsyncIO *IO);
typedef void (*ParseDNSAnswerCb)(AsyncIO*, unsigned char*, int);
typedef void (*FreeDNSReply)(void *DNSData);
/* connection related */
int IP6;
struct hostent *HEnt;
+ struct sockaddr_in6 Addr;
+
int sock;
unsigned short dport;
eNextState NextState;
ev_timer conn_fail,
- conn_timeout;
+ rw_timeout;
ev_io recv_event,
- send_event;
+ send_event,
+ conn_event;
StrBuf *ErrMsg; /* if we fail to connect, or lookup, error goes here. */
/* read/send related... */
};
typedef struct _IOAddHandler {
- void *Ctx;
- EventContextAttach EvAttch;
+ AsyncIO *IO;
+ IO_CallBack EvAttch;
}IOAddHandler;
void FreeAsyncIOContents(AsyncIO *IO);
-int QueueEventContext(void *Ctx, AsyncIO *IO, EventContextAttach CB);
+int QueueEventContext(AsyncIO *IO, IO_CallBack CB);
int ShutDownEventQueue(void);
void InitEventIO(AsyncIO *IO,
void *pData,
- IO_CallBack ReadDone,
- IO_CallBack SendDone,
- IO_CallBack Terminate,
- IO_CallBack Timeout,
- IO_CallBack ConnFail,
- IO_LineReaderCallback LineReader,
- int conn_timeout, int first_rw_timeout,
+ double conn_timeout, double first_rw_timeout,
int ReadFirst);
int QueueQuery(ns_type Type, char *name, AsyncIO *IO, IO_CallBack PostDNS);
void StopClient(AsyncIO *IO);
+
+void SetNextTimeout(AsyncIO *IO, double timeout);