Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
hiredis
Commits
910d46c5
Commit
910d46c5
authored
Jan 04, 2012
by
Pieter Noordhuis
Browse files
Add function that returns timeout on handle
parent
52daeaff
Changes
2
Hide whitespace changes
Inline
Side-by-side
handle.c
View file @
910d46c5
...
@@ -53,6 +53,10 @@ int redis_handle_set_timeout(redis_handle *h, unsigned long us) {
...
@@ -53,6 +53,10 @@ int redis_handle_set_timeout(redis_handle *h, unsigned long us) {
return
REDIS_OK
;
return
REDIS_OK
;
}
}
unsigned
long
redis_handle_get_timeout
(
redis_handle
*
h
)
{
return
h
->
timeout
.
tv_sec
*
1000000
+
h
->
timeout
.
tv_usec
;
}
int
redis_handle_close
(
redis_handle
*
h
)
{
int
redis_handle_close
(
redis_handle
*
h
)
{
if
(
h
->
fd
>=
0
)
{
if
(
h
->
fd
>=
0
)
{
close
(
h
->
fd
);
close
(
h
->
fd
);
...
...
handle.h
View file @
910d46c5
...
@@ -31,6 +31,7 @@ int redis_handle_init(redis_handle *h);
...
@@ -31,6 +31,7 @@ int redis_handle_init(redis_handle *h);
int
redis_handle_close
(
redis_handle
*
);
int
redis_handle_close
(
redis_handle
*
);
int
redis_handle_destroy
(
redis_handle
*
);
int
redis_handle_destroy
(
redis_handle
*
);
int
redis_handle_set_timeout
(
redis_handle
*
,
unsigned
long
us
);
int
redis_handle_set_timeout
(
redis_handle
*
,
unsigned
long
us
);
unsigned
long
redis_handle_get_timeout
(
redis_handle
*
h
);
int
redis_handle_connect_in
(
redis_handle
*
,
struct
sockaddr_in
addr
);
int
redis_handle_connect_in
(
redis_handle
*
,
struct
sockaddr_in
addr
);
int
redis_handle_connect_in6
(
redis_handle
*
,
struct
sockaddr_in6
addr
);
int
redis_handle_connect_in6
(
redis_handle
*
,
struct
sockaddr_in6
addr
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment