Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
be-esb-core
Overview
Overview
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
be-esb-ecosystem-maven
be-esb-core
Commits
e8a25b29
Commit
e8a25b29
authored
Aug 11, 2022
by
s_guodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码整理
parent
1689dc97
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
50 deletions
+2
-50
ShortSocketHandle.java
...rc/com/brilliance/eibs/main/client/ShortSocketHandle.java
+1
-3
SocketServerMode.java
.../brilliance/eibs/server/socket/impl/SocketServerMode.java
+1
-47
No files found.
src/main/src/com/brilliance/eibs/main/client/ShortSocketHandle.java
View file @
e8a25b29
...
@@ -56,7 +56,6 @@ public class ShortSocketHandle implements Runnable {
...
@@ -56,7 +56,6 @@ public class ShortSocketHandle implements Runnable {
}
}
public
void
handleWithHead
()
{
public
void
handleWithHead
()
{
byte
[]
headLenBytes
=
new
byte
[
head_len
];
byte
[]
headLenBytes
=
new
byte
[
head_len
];
int
headLen
=
0
;
int
headLen
=
0
;
...
@@ -80,7 +79,6 @@ public class ShortSocketHandle implements Runnable {
...
@@ -80,7 +79,6 @@ public class ShortSocketHandle implements Runnable {
headLen
=
headLen
+
body_offset
;
headLen
=
headLen
+
body_offset
;
byte
[]
databuffer
=
new
byte
[
headLen
];
byte
[]
databuffer
=
new
byte
[
headLen
];
IOUtils
.
readFully
(
socket
.
getInputStream
(),
databuffer
);
IOUtils
.
readFully
(
socket
.
getInputStream
(),
databuffer
);
// logger.debug("socket接收");
Context
context
=
new
Context
();
Context
context
=
new
Context
();
context
.
addVariable
(
"transaction"
,
"__val"
,
databuffer
);
context
.
addVariable
(
"transaction"
,
"__val"
,
databuffer
);
ResultMsg
resultMsg
=
new
Client
().
call
(
context
,
interfaceName
,
transName
,
args
);
ResultMsg
resultMsg
=
new
Client
().
call
(
context
,
interfaceName
,
transName
,
args
);
...
@@ -108,10 +106,10 @@ public class ShortSocketHandle implements Runnable {
...
@@ -108,10 +106,10 @@ public class ShortSocketHandle implements Runnable {
IOUtils
.
write
(
header
,
socket
.
getOutputStream
());
IOUtils
.
write
(
header
,
socket
.
getOutputStream
());
IOUtils
.
write
(
returnBytes
,
socket
.
getOutputStream
());
IOUtils
.
write
(
returnBytes
,
socket
.
getOutputStream
());
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
// TODO Auto-generated catch block
// TODO Auto-generated catch block
e
.
printStackTrace
();
e
.
printStackTrace
();
logger
.
error
(
e
.
getMessage
(),
e
);
IOUtils
.
closeQuietly
(
socket
);
IOUtils
.
closeQuietly
(
socket
);
}
finally
{
}
finally
{
IOUtils
.
closeQuietly
(
socket
);
IOUtils
.
closeQuietly
(
socket
);
...
...
src/main/src/com/brilliance/eibs/server/socket/impl/SocketServerMode.java
View file @
e8a25b29
...
@@ -21,7 +21,7 @@ import java.util.concurrent.ExecutorService;
...
@@ -21,7 +21,7 @@ import java.util.concurrent.ExecutorService;
/**
/**
* @author hujun
* @author hujun
*
*
<p>
* socket原生模式 ------------modified by weicong on 2016/4/01 -----------
* socket原生模式 ------------modified by weicong on 2016/4/01 -----------
* 兼容sslsocketserver
* 兼容sslsocketserver
*/
*/
...
@@ -99,47 +99,6 @@ public class SocketServerMode implements IServerMode {
...
@@ -99,47 +99,6 @@ public class SocketServerMode implements IServerMode {
this
.
logger
=
logger
;
this
.
logger
=
logger
;
}
}
/*
* public static class Builder { private Logger logger;
*
* private String trustips; // 信任的IP列表 private int port; private int
* queueLen; private int size; private String delayTime; private String
* interfaceName; private String transName; private int timeout; private
* String expression; private Object[] args; private String serverId;
*
* public Builder(int port, int queueLen, int size) { this.port = port;
* this.queueLen = queueLen; this.size = size; }
*
* public Builder setTrustips(String trustips) { this.trustips = trustips;
* return this; }
*
* public Builder setDelayTime(String delayTime) { this.delayTime =
* delayTime; return this; }
*
* public Builder setInterfaceName(String interfaceName) {
* this.interfaceName = interfaceName; return this; }
*
* public Builder setExpression(String expression) { this.expression =
* expression; return this; }
*
* public Builder setTimeout(int timeout) { this.timeout = timeout; return
* this; }
*
* public Builder setTransName(String transName) { this.transName =
* transName; return this; }
*
* public Builder setArgs(Object[] args) { this.args = args; return this; }
*
* public Builder setServerId(String serverId) { this.serverId = serverId;
* return this; }
*
* public Builder setLogger(Logger logger) { this.logger = logger; return
* this; }
*
* public SocketServerMode build() { return new SocketServerMode(this); }
*
* }
*/
@Override
@Override
public
void
startup
()
{
public
void
startup
()
{
...
@@ -164,11 +123,6 @@ public class SocketServerMode implements IServerMode {
...
@@ -164,11 +123,6 @@ public class SocketServerMode implements IServerMode {
if
(
mode
.
equals
(
SocketProxyFactry
.
ORG_SOCKET_TYPE
))
{
if
(
mode
.
equals
(
SocketProxyFactry
.
ORG_SOCKET_TYPE
))
{
if
(
DateUtil
.
isDateValid
(
expression
))
{
if
(
DateUtil
.
isDateValid
(
expression
))
{
executorService
.
submit
(
new
SocketClient
(
interfaceName
,
transName
,
socket
,
args
));
executorService
.
submit
(
new
SocketClient
(
interfaceName
,
transName
,
socket
,
args
));
// counter.incConnectionCount();
// logger.info("Connection count: " +
// counter.getConnCount());
// logger.debug("result:" +
// future.get().getContent());
}
else
{
}
else
{
logger
.
debug
(
"time is invalid."
);
logger
.
debug
(
"time is invalid."
);
IOUtils
.
closeQuietly
(
socket
);
IOUtils
.
closeQuietly
(
socket
);
...
...
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