Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TCP Protocol
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BIAS
Receivers
TCP Protocol
Commits
c9f0e55c
Commit
c9f0e55c
authored
1 year ago
by
Valerio Pastore
Browse files
Options
Downloads
Patches
Plain Diff
.
parent
7b79f3df
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/TCP_Protocol.cpp
+7
-4
7 additions, 4 deletions
src/TCP_Protocol.cpp
with
7 additions
and
4 deletions
src/TCP_Protocol.cpp
+
7
−
4
View file @
c9f0e55c
...
...
@@ -152,8 +152,9 @@ void TCPProtocol::setHost(std::string host) {
setPort
(
port
);
}
else
{
time_t
now
=
time
(
nullptr
);
std
::
cerr
<<
"["
<<
std
::
put_time
(
localtime
(
&
now
),
"%Y-%m-%d %H:%M:%S"
)
<<
"]
\t
[TCP Receiver]
\t
"
<<
"invalid IP address and port format: "
<<
host
<<
std
::
endl
;
std
::
cerr
<<
"["
<<
std
::
put_time
(
localtime
(
&
now
),
"%Y-%m-%d %H:%M:%S"
)
<<
"]
\t
[TCP Receiver]
\t
"
<<
"invalid IP address and port format: "
<<
host
<<
std
::
endl
;
}
}
...
...
@@ -163,7 +164,8 @@ void TCPProtocol::setIp(std::string ip) {
bool
ok
=
true
;
if
(
!
std
::
regex_match
(
ip
,
pattern
))
{
time_t
now
=
time
(
nullptr
);
std
::
cerr
<<
"["
<<
std
::
put_time
(
localtime
(
&
now
),
"%Y-%m-%d %H:%M:%S"
)
<<
"]
\t
[TCP Receiver]
\t
"
<<
"invalid IP address: "
<<
ip
std
::
cerr
<<
"["
<<
std
::
put_time
(
localtime
(
&
now
),
"%Y-%m-%d %H:%M:%S"
)
<<
"]
\t
[TCP Receiver]
\t
"
<<
"invalid IP address: "
<<
ip
<<
", setting to localhost"
<<
std
::
endl
;
ok
=
false
;
this
->
ip
=
std
::
string
(
"localhost"
);
...
...
@@ -178,7 +180,8 @@ void TCPProtocol::setPort(int port) {
this
->
port
=
port
;
else
{
time_t
now
=
time
(
nullptr
);
std
::
cerr
<<
"["
<<
std
::
put_time
(
localtime
(
&
now
),
"%Y-%m-%d %H:%M:%S"
)
<<
"]
\t
[TCP Receiver]
\t
"
<<
"invalid port: "
<<
port
std
::
cerr
<<
"["
<<
std
::
put_time
(
localtime
(
&
now
),
"%Y-%m-%d %H:%M:%S"
)
<<
"]
\t
[TCP Receiver]
\t
"
<<
"invalid port: "
<<
port
<<
", setting to 9003"
<<
std
::
endl
;
this
->
port
=
9003
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment