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
233cd646
Commit
233cd646
authored
Nov 07, 2012
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code cleanup
parent
62d28ae4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
51 deletions
+3
-51
server_kernel_abstract.h
dlib/server/server_kernel_abstract.h
+1
-1
server_kernel_c.h
dlib/server/server_kernel_c.h
+2
-50
No files found.
dlib/server/server_kernel_abstract.h
View file @
233cd646
...
...
@@ -225,7 +225,7 @@ namespace dlib
);
/*!
requires
- i
p is of the form #.#.#.# (dotted quad notation) or ip == ""
- i
s_ip_address(ip) == true or ip == ""
- is_running() == false
ensures
- #get_listening_ip() == ip
...
...
dlib/server/server_kernel_c.h
View file @
233cd646
...
...
@@ -6,6 +6,7 @@
#include "server_kernel_abstract.h"
#include "../algs.h"
#include "../assert.h"
#include "../sockets.h"
#include <string>
#include <sstream>
...
...
@@ -38,15 +39,6 @@ namespace dlib
);
private
:
bool
is_dotted_quad
(
std
::
string
ip
)
const
;
/*!
ensures
returns true if ip is a valid dotted quad ip address else
returns false
!*/
};
...
...
@@ -133,7 +125,7 @@ namespace dlib
{
// make sure requires clause is not broken
DLIB_CASSERT
(
(
(
is_
dotted_quad
(
ip
)
||
ip
==
""
)
&&
(
(
is_
ip_address
(
ip
)
||
ip
==
""
)
&&
this
->
is_running
()
==
false
),
"
\t
void server::set_listening_ip"
<<
"
\n\t
ip == "
<<
ip
...
...
@@ -145,46 +137,6 @@ namespace dlib
server_base
::
set_listening_ip
(
ip
);
}
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// private member function definitions
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
template
<
typename
server_base
>
bool
server_kernel_c
<
server_base
>::
is_dotted_quad
(
std
::
string
ip
)
const
{
int
num
;
char
dot
;
std
::
istringstream
sin
(
ip
);
for
(
int
i
=
0
;
i
<
3
;
++
i
)
{
sin
>>
num
;
if
(
!
sin
)
return
false
;
if
(
num
<
0
||
num
>
255
)
return
false
;
sin
>>
dot
;
if
(
!
sin
)
return
false
;
if
(
dot
!=
'.'
)
return
false
;
}
sin
>>
num
;
if
(
!
sin
)
return
false
;
if
(
num
<
0
||
num
>
255
)
return
false
;
if
(
sin
.
get
()
!=
EOF
)
return
false
;
return
true
;
}
// ----------------------------------------------------------------------------------------
}
...
...
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