Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
e0cabc89
Commit
e0cabc89
authored
Apr 06, 2015
by
Suresh Namla
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dlib::http_client - Changes for configured Socket Connection Initialization Timeout
parent
80ea9c66
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
http_client.cpp
dlib/http_client/http_client.cpp
+1
-1
http_client.h
dlib/http_client/http_client.h
+3
-1
No files found.
dlib/http_client/http_client.cpp
View file @
e0cabc89
...
...
@@ -553,7 +553,7 @@ namespace dlib
dlib
::
connection
*
conn
(
0
);
try
{
conn
=
dlib
::
connect
(
host
,
port
);
conn
=
dlib
::
connect
(
host
,
port
,
connection_timeout
);
}
catch
(
const
dlib
::
socket_error
&
e
)
{
...
...
dlib/http_client/http_client.h
View file @
e0cabc89
...
...
@@ -10,6 +10,7 @@
// Default timeout after 60 seconds
#define DEFAULT_TIMEOUT 60000
#define DEFAULT_CONNECTION_TIMEOUT 21000
namespace
dlib
{
...
...
@@ -50,7 +51,7 @@ namespace dlib
void
set_timeout
(
unsigned
int
milliseconds
=
DEFAULT_TIMEOUT
)
{
timeout
=
milliseconds
;
}
void
set_connectiontimeout
(
unsigned
int
milliseconds
=
DEFAULT_CONNECTION_TIMEOUT
)
{
connection_timeout
=
milliseconds
;
}
string_to_stringvector
get_returned_headers
()
const
{
return
returned_headers
;
}
short
get_http_return
()
const
{
return
http_return
;
}
...
...
@@ -86,6 +87,7 @@ namespace dlib
std
::
string
returned_body
,
error_field
;
unsigned
int
timeout
;
unsigned
int
connection_timeout
;
fnOnDownload
OnDownload
;
void
*
user_info
;
...
...
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