/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2003 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2005 Hiroyuki Yamamoto
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#include <glib.h>
#include <time.h>
-#include <sys/time.h>
#include <unistd.h>
#include "socket.h"
SESSION_SEND,
SESSION_RECV,
SESSION_EOF,
+ SESSION_TIMEOUT,
SESSION_ERROR,
SESSION_DISCONNECTED
} SessionState;
SessionState state;
time_t last_access_time;
- struct timeval tv_prev;
+ GTimeVal tv_prev;
gint conn_id;
GByteArray *read_data_buf;
gchar *read_data_terminator;
+ /* buffer for short messages */
gchar *write_buf;
gchar *write_buf_p;
gint write_buf_len;
+ /* buffer for large data */
+ const guchar *write_data;
+ const guchar *write_data_p;
+ gint write_data_len;
+
+ guint timeout_tag;
+ guint timeout_interval;
+
gpointer data;
/* virtual methods to parse server responses */
void session_destroy (Session *session);
gboolean session_is_connected (Session *session);
+void session_set_access_time (Session *session);
+
+void session_set_timeout (Session *session,
+ guint interval);
+
void session_set_recv_message_notify (Session *session,
RecvMsgNotify notify_func,
gpointer data);