Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
GnssServer
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
zhushanglei
GnssServer
Commits
06c4b97c
Commit
06c4b97c
authored
Dec 02, 2022
by
zhushanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
websocket和tcpsocket
parent
94fe404f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
WebSocketHandler.java
src/main/java/server/WebSocketHandler.java
+2
-2
No files found.
src/main/java/server/WebSocketHandler.java
View file @
06c4b97c
...
@@ -23,7 +23,7 @@ public class WebSocketHandler extends SimpleChannelInboundHandler<Object> {
...
@@ -23,7 +23,7 @@ public class WebSocketHandler extends SimpleChannelInboundHandler<Object> {
}
else
{
}
else
{
msg
=
String
.
valueOf
(
object
);
msg
=
String
.
valueOf
(
object
);
}
}
System
.
out
.
println
(
"msg:"
+
msg
);
logger
.
info
(
"msg:"
+
msg
);
for
(
String
key:
map
.
keySet
())
{
for
(
String
key:
map
.
keySet
())
{
if
(
key
.
equals
(
ctx
.
channel
().
id
().
toString
())){
if
(
key
.
equals
(
ctx
.
channel
().
id
().
toString
())){
...
@@ -58,7 +58,7 @@ public class WebSocketHandler extends SimpleChannelInboundHandler<Object> {
...
@@ -58,7 +58,7 @@ public class WebSocketHandler extends SimpleChannelInboundHandler<Object> {
@Override
@Override
public
void
exceptionCaught
(
ChannelHandlerContext
ctx
,
Throwable
cause
)
throws
Exception
{
public
void
exceptionCaught
(
ChannelHandlerContext
ctx
,
Throwable
cause
)
throws
Exception
{
System
.
out
.
println
(
"exceptionCaught::"
+
cause
.
getMessage
());
logger
.
error
(
"exceptionCaught::"
+
cause
.
getMessage
());
String
clientId
=
ctx
.
channel
().
id
().
toString
();
String
clientId
=
ctx
.
channel
().
id
().
toString
();
map
.
remove
(
clientId
);
map
.
remove
(
clientId
);
ctx
.
close
();
ctx
.
close
();
...
...
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