forked from enlightenment/efl
yoda-style inactivity timeout.
s/inactivity_timeout/timeout_inactivity/g so it matches the EFL names with scope first, like timeout_connect, etc.
This commit is contained in:
parent
e9a72ea8f4
commit
21759f713a
|
@ -893,7 +893,7 @@ main(int argc, char **argv)
|
||||||
efl_io_copier_line_delimiter_set(efl_added, &line_delm_slice), /* optional */
|
efl_io_copier_line_delimiter_set(efl_added, &line_delm_slice), /* optional */
|
||||||
efl_io_copier_buffer_limit_set(efl_added, buffer_limit), /* optional, defaults to unlimited */
|
efl_io_copier_buffer_limit_set(efl_added, buffer_limit), /* optional, defaults to unlimited */
|
||||||
efl_io_copier_read_chunk_size_set(efl_added, read_chunk_size), /* optional, defaults to 4096 */
|
efl_io_copier_read_chunk_size_set(efl_added, read_chunk_size), /* optional, defaults to 4096 */
|
||||||
efl_io_copier_inactivity_timeout_set(efl_added, timeout), /* optional, defaults to 0.0 (disabled) */
|
efl_io_copier_timeout_inactivity_set(efl_added, timeout), /* optional, defaults to 0.0 (disabled) */
|
||||||
efl_event_callback_array_add(efl_added, copier_cbs(), NULL) /* recommended, at least EFL_IO_COPIER_EVENT_DONE. */
|
efl_event_callback_array_add(efl_added, copier_cbs(), NULL) /* recommended, at least EFL_IO_COPIER_EVENT_DONE. */
|
||||||
);
|
);
|
||||||
if (!copier)
|
if (!copier)
|
||||||
|
|
|
@ -288,7 +288,7 @@ main(int argc, char **argv)
|
||||||
char *protocol = NULL;
|
char *protocol = NULL;
|
||||||
unsigned long buffer_limit = 0;
|
unsigned long buffer_limit = 0;
|
||||||
unsigned long read_chunk_size = 0;
|
unsigned long read_chunk_size = 0;
|
||||||
double inactivity_timeout = 0.0;
|
double timeout_inactivity = 0.0;
|
||||||
double connect_timeout = 0.0;
|
double connect_timeout = 0.0;
|
||||||
Eina_Bool quit_option = EINA_FALSE;
|
Eina_Bool quit_option = EINA_FALSE;
|
||||||
Ecore_Getopt_Value values[] = {
|
Ecore_Getopt_Value values[] = {
|
||||||
|
@ -299,7 +299,7 @@ main(int argc, char **argv)
|
||||||
ECORE_GETOPT_VALUE_STR(line_delimiter_str),
|
ECORE_GETOPT_VALUE_STR(line_delimiter_str),
|
||||||
ECORE_GETOPT_VALUE_ULONG(buffer_limit),
|
ECORE_GETOPT_VALUE_ULONG(buffer_limit),
|
||||||
ECORE_GETOPT_VALUE_ULONG(read_chunk_size),
|
ECORE_GETOPT_VALUE_ULONG(read_chunk_size),
|
||||||
ECORE_GETOPT_VALUE_DOUBLE(inactivity_timeout),
|
ECORE_GETOPT_VALUE_DOUBLE(timeout_inactivity),
|
||||||
ECORE_GETOPT_VALUE_DOUBLE(connect_timeout),
|
ECORE_GETOPT_VALUE_DOUBLE(connect_timeout),
|
||||||
|
|
||||||
/* standard block to provide version, copyright, license and help */
|
/* standard block to provide version, copyright, license and help */
|
||||||
|
@ -379,7 +379,7 @@ main(int argc, char **argv)
|
||||||
efl_io_buffered_stream_max_queue_size_input_set(efl_added, buffer_limit), /* optional, defaults to unlimited */
|
efl_io_buffered_stream_max_queue_size_input_set(efl_added, buffer_limit), /* optional, defaults to unlimited */
|
||||||
efl_io_buffered_stream_max_queue_size_output_set(efl_added, buffer_limit), /* optional, defaults to unlimited */
|
efl_io_buffered_stream_max_queue_size_output_set(efl_added, buffer_limit), /* optional, defaults to unlimited */
|
||||||
efl_io_buffered_stream_read_chunk_size_set(efl_added, read_chunk_size), /* optional, defaults to 4096 */
|
efl_io_buffered_stream_read_chunk_size_set(efl_added, read_chunk_size), /* optional, defaults to 4096 */
|
||||||
efl_io_buffered_stream_inactivity_timeout_set(efl_added, inactivity_timeout), /* optional, defaults to 0.0 (disabled) */
|
efl_io_buffered_stream_timeout_inactivity_set(efl_added, timeout_inactivity), /* optional, defaults to 0.0 (disabled) */
|
||||||
efl_net_dialer_timeout_dial_set(efl_added, connect_timeout), /* optional, defaults to 0.0 (disabled) */
|
efl_net_dialer_timeout_dial_set(efl_added, connect_timeout), /* optional, defaults to 0.0 (disabled) */
|
||||||
efl_event_callback_array_add(efl_added, dialer_cbs(), NULL));
|
efl_event_callback_array_add(efl_added, dialer_cbs(), NULL));
|
||||||
|
|
||||||
|
|
|
@ -159,7 +159,7 @@ _send_copier_done(void *data, const Efl_Event *event)
|
||||||
if (d->recv_copier)
|
if (d->recv_copier)
|
||||||
{
|
{
|
||||||
/* only start the reader inactivity timeout once the sender is done */
|
/* only start the reader inactivity timeout once the sender is done */
|
||||||
efl_io_copier_inactivity_timeout_set(d->recv_copier, efl_io_copier_inactivity_timeout_get(copier));
|
efl_io_copier_timeout_inactivity_set(d->recv_copier, efl_io_copier_timeout_inactivity_get(copier));
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(stderr, "INFO: send copier done, check if should close %p\n", copier);
|
fprintf(stderr, "INFO: send copier done, check if should close %p\n", copier);
|
||||||
|
@ -335,7 +335,7 @@ _server_client_add(void *data EINA_UNUSED, const Efl_Event *event)
|
||||||
Eo *echo_copier = efl_add(EFL_IO_COPIER_CLASS, efl_parent_get(client),
|
Eo *echo_copier = efl_add(EFL_IO_COPIER_CLASS, efl_parent_get(client),
|
||||||
efl_io_copier_source_set(efl_added, client),
|
efl_io_copier_source_set(efl_added, client),
|
||||||
efl_io_copier_destination_set(efl_added, client),
|
efl_io_copier_destination_set(efl_added, client),
|
||||||
efl_io_copier_inactivity_timeout_set(efl_added, timeout),
|
efl_io_copier_timeout_inactivity_set(efl_added, timeout),
|
||||||
efl_event_callback_array_add(efl_added, echo_copier_cbs(), client),
|
efl_event_callback_array_add(efl_added, echo_copier_cbs(), client),
|
||||||
efl_io_closer_close_on_destructor_set(efl_added, EINA_TRUE) /* we want to auto-close as we have a single copier */
|
efl_io_closer_close_on_destructor_set(efl_added, EINA_TRUE) /* we want to auto-close as we have a single copier */
|
||||||
);
|
);
|
||||||
|
@ -378,7 +378,7 @@ _server_client_add(void *data EINA_UNUSED, const Efl_Event *event)
|
||||||
d->send_copier = efl_add(EFL_IO_COPIER_CLASS, efl_parent_get(client),
|
d->send_copier = efl_add(EFL_IO_COPIER_CLASS, efl_parent_get(client),
|
||||||
efl_io_copier_source_set(efl_added, send_buffer),
|
efl_io_copier_source_set(efl_added, send_buffer),
|
||||||
efl_io_copier_destination_set(efl_added, client),
|
efl_io_copier_destination_set(efl_added, client),
|
||||||
efl_io_copier_inactivity_timeout_set(efl_added, timeout),
|
efl_io_copier_timeout_inactivity_set(efl_added, timeout),
|
||||||
efl_event_callback_array_add(efl_added, send_copier_cbs(), d),
|
efl_event_callback_array_add(efl_added, send_copier_cbs(), d),
|
||||||
efl_io_closer_close_on_destructor_set(efl_added, EINA_FALSE) /* we must wait both copiers to finish before we close! */
|
efl_io_closer_close_on_destructor_set(efl_added, EINA_FALSE) /* we must wait both copiers to finish before we close! */
|
||||||
);
|
);
|
||||||
|
@ -395,7 +395,7 @@ _server_client_add(void *data EINA_UNUSED, const Efl_Event *event)
|
||||||
d->recv_copier = efl_add(EFL_IO_COPIER_CLASS, efl_parent_get(client),
|
d->recv_copier = efl_add(EFL_IO_COPIER_CLASS, efl_parent_get(client),
|
||||||
efl_io_copier_source_set(efl_added, client),
|
efl_io_copier_source_set(efl_added, client),
|
||||||
efl_io_copier_destination_set(efl_added, recv_buffer),
|
efl_io_copier_destination_set(efl_added, recv_buffer),
|
||||||
efl_io_copier_inactivity_timeout_set(efl_added, 0.0), /* we'll only set an inactivity timeout once the sender is done */
|
efl_io_copier_timeout_inactivity_set(efl_added, 0.0), /* we'll only set an inactivity timeout once the sender is done */
|
||||||
efl_event_callback_array_add(efl_added, recv_copier_cbs(), d),
|
efl_event_callback_array_add(efl_added, recv_copier_cbs(), d),
|
||||||
efl_io_closer_close_on_destructor_set(efl_added, EINA_FALSE) /* we must wait both copiers to finish before we close! */
|
efl_io_closer_close_on_destructor_set(efl_added, EINA_FALSE) /* we must wait both copiers to finish before we close! */
|
||||||
);
|
);
|
||||||
|
|
|
@ -166,7 +166,7 @@ _server_client_add(void *data EINA_UNUSED, const Efl_Event *event)
|
||||||
*/
|
*/
|
||||||
efl_event_callback_array_add(client, client_cbs(), NULL);
|
efl_event_callback_array_add(client, client_cbs(), NULL);
|
||||||
|
|
||||||
efl_io_buffered_stream_inactivity_timeout_set(client, timeout);
|
efl_io_buffered_stream_timeout_inactivity_set(client, timeout);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Since sockets are reader/writer/closer objects, we can use the
|
* Since sockets are reader/writer/closer objects, we can use the
|
||||||
|
|
|
@ -131,7 +131,7 @@ _server_client_add(void *data EINA_UNUSED, const Efl_Event *event)
|
||||||
echo_copier = efl_add(EFL_IO_COPIER_CLASS, efl_parent_get(ssl),
|
echo_copier = efl_add(EFL_IO_COPIER_CLASS, efl_parent_get(ssl),
|
||||||
efl_io_copier_source_set(efl_added, ssl),
|
efl_io_copier_source_set(efl_added, ssl),
|
||||||
efl_io_copier_destination_set(efl_added, ssl),
|
efl_io_copier_destination_set(efl_added, ssl),
|
||||||
efl_io_copier_inactivity_timeout_set(efl_added, timeout),
|
efl_io_copier_timeout_inactivity_set(efl_added, timeout),
|
||||||
efl_event_callback_array_add(efl_added, echo_copier_cbs(), ssl),
|
efl_event_callback_array_add(efl_added, echo_copier_cbs(), ssl),
|
||||||
efl_io_closer_close_on_destructor_set(efl_added, EINA_TRUE) /* we want to auto-close as we have a single copier */
|
efl_io_closer_close_on_destructor_set(efl_added, EINA_TRUE) /* we want to auto-close as we have a single copier */
|
||||||
);
|
);
|
||||||
|
|
|
@ -466,21 +466,21 @@ _efl_io_buffered_stream_line_delimiter_get(Eo *o EINA_UNUSED, Efl_Io_Buffered_St
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
_efl_io_buffered_stream_inactivity_timeout_set(Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd, double seconds)
|
_efl_io_buffered_stream_timeout_inactivity_set(Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd, double seconds)
|
||||||
{
|
{
|
||||||
if (pd->receiver)
|
if (pd->receiver)
|
||||||
efl_io_copier_inactivity_timeout_set(pd->receiver, seconds);
|
efl_io_copier_timeout_inactivity_set(pd->receiver, seconds);
|
||||||
if (pd->sender)
|
if (pd->sender)
|
||||||
efl_io_copier_inactivity_timeout_set(pd->sender, seconds);
|
efl_io_copier_timeout_inactivity_set(pd->sender, seconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static double
|
EOLIAN static double
|
||||||
_efl_io_buffered_stream_inactivity_timeout_get(Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd)
|
_efl_io_buffered_stream_timeout_inactivity_get(Eo *o EINA_UNUSED, Efl_Io_Buffered_Stream_Data *pd)
|
||||||
{
|
{
|
||||||
if (pd->receiver)
|
if (pd->receiver)
|
||||||
return efl_io_copier_inactivity_timeout_get(pd->receiver);
|
return efl_io_copier_timeout_inactivity_get(pd->receiver);
|
||||||
if (pd->sender)
|
if (pd->sender)
|
||||||
return efl_io_copier_inactivity_timeout_get(pd->sender);
|
return efl_io_copier_timeout_inactivity_get(pd->sender);
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,7 @@ class Efl.Io.Buffered_Stream (Efl.Loop_User, Efl.Io.Reader, Efl.Io.Writer, Efl.I
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@property inactivity_timeout {
|
@property timeout_inactivity {
|
||||||
[[Error as ETIMEDOUT if it becomes inactive for some time.
|
[[Error as ETIMEDOUT if it becomes inactive for some time.
|
||||||
|
|
||||||
If no activity, that is no read or write in the given
|
If no activity, that is no read or write in the given
|
||||||
|
|
|
@ -24,7 +24,7 @@ typedef struct _Efl_Io_Copier_Data
|
||||||
struct {
|
struct {
|
||||||
uint64_t read, written, total;
|
uint64_t read, written, total;
|
||||||
} progress;
|
} progress;
|
||||||
double inactivity_timeout;
|
double timeout_inactivity;
|
||||||
Eina_Bool closed;
|
Eina_Bool closed;
|
||||||
Eina_Bool done;
|
Eina_Bool done;
|
||||||
Eina_Bool force_dispatch;
|
Eina_Bool force_dispatch;
|
||||||
|
@ -73,7 +73,7 @@ static void _efl_io_copier_read(Eo *o, Efl_Io_Copier_Data *pd);
|
||||||
while (0)
|
while (0)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_efl_io_copier_inactivity_timeout_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
_efl_io_copier_timeout_inactivity_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
||||||
{
|
{
|
||||||
Eo *o = data;
|
Eo *o = data;
|
||||||
Eina_Error err = ETIMEDOUT;
|
Eina_Error err = ETIMEDOUT;
|
||||||
|
@ -81,13 +81,13 @@ _efl_io_copier_inactivity_timeout_cb(void *data, const Efl_Event *ev EINA_UNUSED
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_efl_io_copier_inactivity_timeout_reschedule(Eo *o, Efl_Io_Copier_Data *pd)
|
_efl_io_copier_timeout_inactivity_reschedule(Eo *o, Efl_Io_Copier_Data *pd)
|
||||||
{
|
{
|
||||||
if (pd->inactivity_timer) efl_future_cancel(pd->inactivity_timer);
|
if (pd->inactivity_timer) efl_future_cancel(pd->inactivity_timer);
|
||||||
if (pd->inactivity_timeout <= 0.0) return;
|
if (pd->timeout_inactivity <= 0.0) return;
|
||||||
|
|
||||||
efl_future_use(&pd->inactivity_timer, efl_loop_timeout(efl_loop_get(o), pd->inactivity_timeout, o));
|
efl_future_use(&pd->inactivity_timer, efl_loop_timeout(efl_loop_get(o), pd->timeout_inactivity, o));
|
||||||
efl_future_then(pd->inactivity_timer, _efl_io_copier_inactivity_timeout_cb, NULL, NULL, o);
|
efl_future_then(pd->inactivity_timer, _efl_io_copier_timeout_inactivity_cb, NULL, NULL, o);
|
||||||
efl_future_link(o, pd->inactivity_timer);
|
efl_future_link(o, pd->inactivity_timer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ _efl_io_copier_job(void *data, const Efl_Event *ev EINA_UNUSED)
|
||||||
{
|
{
|
||||||
efl_event_callback_call(o, EFL_IO_COPIER_EVENT_PROGRESS, NULL);
|
efl_event_callback_call(o, EFL_IO_COPIER_EVENT_PROGRESS, NULL);
|
||||||
if (pd->closed) return; /* cb may call close */
|
if (pd->closed) return; /* cb may call close */
|
||||||
_efl_io_copier_inactivity_timeout_reschedule(o, pd);
|
_efl_io_copier_timeout_inactivity_reschedule(o, pd);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pd->source || efl_io_reader_eos_get(pd->source))
|
if (!pd->source || efl_io_reader_eos_get(pd->source))
|
||||||
|
@ -729,16 +729,16 @@ _efl_io_copier_binbuf_steal(Eo *o EINA_UNUSED, Efl_Io_Copier_Data *pd)
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
_efl_io_copier_inactivity_timeout_set(Eo *o, Efl_Io_Copier_Data *pd, double seconds)
|
_efl_io_copier_timeout_inactivity_set(Eo *o, Efl_Io_Copier_Data *pd, double seconds)
|
||||||
{
|
{
|
||||||
pd->inactivity_timeout = seconds;
|
pd->timeout_inactivity = seconds;
|
||||||
_efl_io_copier_inactivity_timeout_reschedule(o, pd);
|
_efl_io_copier_timeout_inactivity_reschedule(o, pd);
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static double
|
EOLIAN static double
|
||||||
_efl_io_copier_inactivity_timeout_get(Eo *o EINA_UNUSED, Efl_Io_Copier_Data *pd)
|
_efl_io_copier_timeout_inactivity_get(Eo *o EINA_UNUSED, Efl_Io_Copier_Data *pd)
|
||||||
{
|
{
|
||||||
return pd->inactivity_timeout;
|
return pd->timeout_inactivity;
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static Eina_Bool
|
EOLIAN static Eina_Bool
|
||||||
|
@ -781,7 +781,7 @@ _efl_io_copier_flush(Eo *o, Efl_Io_Copier_Data *pd, Eina_Bool may_block, Eina_Bo
|
||||||
{
|
{
|
||||||
efl_event_callback_call(o, EFL_IO_COPIER_EVENT_PROGRESS, NULL);
|
efl_event_callback_call(o, EFL_IO_COPIER_EVENT_PROGRESS, NULL);
|
||||||
if (pd->closed) return EINA_TRUE; /* cb may call close */
|
if (pd->closed) return EINA_TRUE; /* cb may call close */
|
||||||
_efl_io_copier_inactivity_timeout_reschedule(o, pd);
|
_efl_io_copier_timeout_inactivity_reschedule(o, pd);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pd->source || efl_io_reader_eos_get(pd->source))
|
if (!pd->source || efl_io_reader_eos_get(pd->source))
|
||||||
|
@ -834,7 +834,7 @@ _efl_io_copier_efl_object_constructor(Eo *o, Efl_Io_Copier_Data *pd)
|
||||||
pd->buf = eina_binbuf_new();
|
pd->buf = eina_binbuf_new();
|
||||||
pd->close_on_exec = EINA_TRUE;
|
pd->close_on_exec = EINA_TRUE;
|
||||||
pd->close_on_destructor = EINA_TRUE;
|
pd->close_on_destructor = EINA_TRUE;
|
||||||
pd->inactivity_timeout = 0.0;
|
pd->timeout_inactivity = 0.0;
|
||||||
|
|
||||||
EINA_SAFETY_ON_NULL_RETURN_VAL(pd->buf, NULL);
|
EINA_SAFETY_ON_NULL_RETURN_VAL(pd->buf, NULL);
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ class Efl.Io.Copier (Efl.Loop_User, Efl.Io.Closer) {
|
||||||
- The "error" event is reported if the @Efl.Io.Reader.read,
|
- The "error" event is reported if the @Efl.Io.Reader.read,
|
||||||
@Efl.Io.Writer.write or some other internal error happened,
|
@Efl.Io.Writer.write or some other internal error happened,
|
||||||
like out of memory. Another common error is ETIMEDOUT if
|
like out of memory. Another common error is ETIMEDOUT if
|
||||||
@.inactivity_timeout is set.
|
@.timeout_inactivity is set.
|
||||||
|
|
||||||
A copier is handful to simplify common I/O use cases, such as:
|
A copier is handful to simplify common I/O use cases, such as:
|
||||||
|
|
||||||
|
@ -270,7 +270,7 @@ class Efl.Io.Copier (Efl.Loop_User, Efl.Io.Closer) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@property inactivity_timeout {
|
@property timeout_inactivity {
|
||||||
[[Terminate the copier with ETIMEDOUT if it becomes inactive for some time.
|
[[Terminate the copier with ETIMEDOUT if it becomes inactive for some time.
|
||||||
|
|
||||||
If the copier cannot do any read or write in the given
|
If the copier cannot do any read or write in the given
|
||||||
|
|
|
@ -656,14 +656,14 @@ EAPI void
|
||||||
ecore_con_client_timeout_set(Ecore_Con_Client *cl, double timeout)
|
ecore_con_client_timeout_set(Ecore_Con_Client *cl, double timeout)
|
||||||
{
|
{
|
||||||
ECORE_CON_CLIENT_CHECK_RETURN(cl);
|
ECORE_CON_CLIENT_CHECK_RETURN(cl);
|
||||||
efl_io_buffered_stream_inactivity_timeout_set(cl->socket, timeout);
|
efl_io_buffered_stream_timeout_inactivity_set(cl->socket, timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI double
|
EAPI double
|
||||||
ecore_con_client_timeout_get(const Ecore_Con_Client *cl)
|
ecore_con_client_timeout_get(const Ecore_Con_Client *cl)
|
||||||
{
|
{
|
||||||
ECORE_CON_CLIENT_CHECK_RETURN(cl, -1.0);
|
ECORE_CON_CLIENT_CHECK_RETURN(cl, -1.0);
|
||||||
return efl_io_buffered_stream_inactivity_timeout_get(cl->socket);
|
return efl_io_buffered_stream_timeout_inactivity_get(cl->socket);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void *
|
EAPI void *
|
||||||
|
@ -1775,7 +1775,7 @@ _ecore_con_server_dialer_set(Ecore_Con_Server *svr, Eo *dialer)
|
||||||
svr->dialer = dialer;
|
svr->dialer = dialer;
|
||||||
efl_io_closer_close_on_exec_set(dialer, EINA_TRUE);
|
efl_io_closer_close_on_exec_set(dialer, EINA_TRUE);
|
||||||
efl_io_closer_close_on_destructor_set(dialer, EINA_TRUE);
|
efl_io_closer_close_on_destructor_set(dialer, EINA_TRUE);
|
||||||
efl_io_buffered_stream_inactivity_timeout_set(dialer, svr->timeout);
|
efl_io_buffered_stream_timeout_inactivity_set(dialer, svr->timeout);
|
||||||
efl_event_callback_array_add(dialer, _ecore_con_server_dialer_cbs(), svr);
|
efl_event_callback_array_add(dialer, _ecore_con_server_dialer_cbs(), svr);
|
||||||
|
|
||||||
if (efl_isa(inner_dialer, EFL_NET_DIALER_TCP_CLASS))
|
if (efl_isa(inner_dialer, EFL_NET_DIALER_TCP_CLASS))
|
||||||
|
@ -2138,7 +2138,7 @@ ecore_con_server_timeout_set(Ecore_Con_Server *svr, double timeout)
|
||||||
svr->timeout = timeout; /* used for new clients */
|
svr->timeout = timeout; /* used for new clients */
|
||||||
|
|
||||||
if (!svr->dialer) return;
|
if (!svr->dialer) return;
|
||||||
efl_io_buffered_stream_inactivity_timeout_set(svr->dialer, timeout);
|
efl_io_buffered_stream_timeout_inactivity_set(svr->dialer, timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI double
|
EAPI double
|
||||||
|
|
|
@ -11,7 +11,7 @@ typedef struct
|
||||||
const Efl_Class *inner_class;
|
const Efl_Class *inner_class;
|
||||||
Eina_Stringshare *proxy_url;
|
Eina_Stringshare *proxy_url;
|
||||||
double dial_timeout;
|
double dial_timeout;
|
||||||
double inactivity_timeout;
|
double timeout_inactivity;
|
||||||
size_t max_queue_size_input;
|
size_t max_queue_size_input;
|
||||||
size_t max_queue_size_output;
|
size_t max_queue_size_output;
|
||||||
size_t read_chunk_size;
|
size_t read_chunk_size;
|
||||||
|
@ -19,7 +19,7 @@ typedef struct
|
||||||
struct {
|
struct {
|
||||||
Eina_Bool proxy_url;
|
Eina_Bool proxy_url;
|
||||||
Eina_Bool dial_timeout;
|
Eina_Bool dial_timeout;
|
||||||
Eina_Bool inactivity_timeout;
|
Eina_Bool timeout_inactivity;
|
||||||
Eina_Bool max_queue_size_input;
|
Eina_Bool max_queue_size_input;
|
||||||
Eina_Bool max_queue_size_output;
|
Eina_Bool max_queue_size_output;
|
||||||
Eina_Bool read_chunk_size;
|
Eina_Bool read_chunk_size;
|
||||||
|
@ -132,10 +132,10 @@ _efl_net_dialer_simple_efl_io_buffered_stream_inner_io_set(Eo *o, Efl_Net_Dialer
|
||||||
}
|
}
|
||||||
|
|
||||||
/* apply pending io buffered stream (own) values */
|
/* apply pending io buffered stream (own) values */
|
||||||
if (pd->pending.inactivity_timeout)
|
if (pd->pending.timeout_inactivity)
|
||||||
{
|
{
|
||||||
pd->pending.inactivity_timeout = EINA_FALSE;
|
pd->pending.timeout_inactivity = EINA_FALSE;
|
||||||
efl_io_buffered_stream_inactivity_timeout_set(o, pd->inactivity_timeout);
|
efl_io_buffered_stream_timeout_inactivity_set(o, pd->timeout_inactivity);
|
||||||
}
|
}
|
||||||
if (pd->pending.max_queue_size_input)
|
if (pd->pending.max_queue_size_input)
|
||||||
{
|
{
|
||||||
|
@ -224,25 +224,25 @@ _efl_net_dialer_simple_efl_net_dialer_timeout_dial_get(Eo *o, Efl_Net_Dialer_Sim
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
_efl_net_dialer_simple_efl_io_buffered_stream_inactivity_timeout_set(Eo *o, Efl_Net_Dialer_Simple_Data *pd, double seconds)
|
_efl_net_dialer_simple_efl_io_buffered_stream_timeout_inactivity_set(Eo *o, Efl_Net_Dialer_Simple_Data *pd, double seconds)
|
||||||
{
|
{
|
||||||
Eo *inner_io = efl_io_buffered_stream_inner_io_get(o);
|
Eo *inner_io = efl_io_buffered_stream_inner_io_get(o);
|
||||||
|
|
||||||
if (!inner_io)
|
if (!inner_io)
|
||||||
{
|
{
|
||||||
pd->inactivity_timeout = seconds;
|
pd->timeout_inactivity = seconds;
|
||||||
pd->pending.inactivity_timeout = EINA_TRUE;
|
pd->pending.timeout_inactivity = EINA_TRUE;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
efl_io_buffered_stream_inactivity_timeout_set(efl_super(o, MY_CLASS), seconds);
|
efl_io_buffered_stream_timeout_inactivity_set(efl_super(o, MY_CLASS), seconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static double
|
EOLIAN static double
|
||||||
_efl_net_dialer_simple_efl_io_buffered_stream_inactivity_timeout_get(Eo *o, Efl_Net_Dialer_Simple_Data *pd)
|
_efl_net_dialer_simple_efl_io_buffered_stream_timeout_inactivity_get(Eo *o, Efl_Net_Dialer_Simple_Data *pd)
|
||||||
{
|
{
|
||||||
Eo *inner_io = efl_io_buffered_stream_inner_io_get(o);
|
Eo *inner_io = efl_io_buffered_stream_inner_io_get(o);
|
||||||
if (!inner_io) return pd->inactivity_timeout;
|
if (!inner_io) return pd->timeout_inactivity;
|
||||||
return efl_io_buffered_stream_inactivity_timeout_get(efl_super(o, MY_CLASS));
|
return efl_io_buffered_stream_timeout_inactivity_get(efl_super(o, MY_CLASS));
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
|
|
|
@ -76,7 +76,7 @@ class Efl.Net.Dialer.Simple (Efl.Net.Socket.Simple, Efl.Net.Dialer) {
|
||||||
Efl.Net.Dialer.connected.get;
|
Efl.Net.Dialer.connected.get;
|
||||||
Efl.Net.Dialer.proxy;
|
Efl.Net.Dialer.proxy;
|
||||||
Efl.Net.Dialer.timeout_dial;
|
Efl.Net.Dialer.timeout_dial;
|
||||||
Efl.Io.Buffered_Stream.inactivity_timeout;
|
Efl.Io.Buffered_Stream.timeout_inactivity;
|
||||||
Efl.Io.Buffered_Stream.max_queue_size_input;
|
Efl.Io.Buffered_Stream.max_queue_size_input;
|
||||||
Efl.Io.Buffered_Stream.max_queue_size_output;
|
Efl.Io.Buffered_Stream.max_queue_size_output;
|
||||||
Efl.Io.Buffered_Stream.read_chunk_size;
|
Efl.Io.Buffered_Stream.read_chunk_size;
|
||||||
|
|
Loading…
Reference in New Issue