Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
joram
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
joram
joram
Commits
96b8c245
Commit
96b8c245
authored
Jan 12, 2021
by
Andre Freyssinet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug fix [JORAM-376]: Allows to configure SO_LINGER on JNDI socket.
parent
de028c6f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
joram/jndi/shared/src/main/java/fr/dyade/aaa/jndi2/msg/IOControl.java
...hared/src/main/java/fr/dyade/aaa/jndi2/msg/IOControl.java
+13
-5
No files found.
joram/jndi/shared/src/main/java/fr/dyade/aaa/jndi2/msg/IOControl.java
View file @
96b8c245
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2001 - 20
19
ScalAgent Distributed Technologies
* Copyright (C) 2001 - 20
21
ScalAgent Distributed Technologies
* Copyright (C) 1996 - 2000 Dyade
*
* This library is free software; you can redistribute it and/or
...
...
@@ -51,7 +51,7 @@ public class IOControl {
public
static
final
int
DEFAULT_SO_TIMEOUT
=
5000
;
/**
*
Enable/disable SO_TIMEOUT with the specified timeout in milliseconds.
* Enable/disable SO_TIMEOUT with the specified timeout in milliseconds.
* The default value is zero which means the option is disabled.
* This value can be adjusted by setting the environment property
* <code>fr.dyade.aaa.jndi2.socketTimeOut</code>.
...
...
@@ -59,8 +59,15 @@ public class IOControl {
* InputStream associated with this Socket will block for only this amount
* of time.
*/
private
static
int
socketTimeOut
=
Configuration
.
getInteger
(
SO_TIMEOUT_PROP
,
DEFAULT_SO_TIMEOUT
).
intValue
();
private
static
int
socketTimeOut
=
Configuration
.
getInteger
(
SO_TIMEOUT_PROP
,
DEFAULT_SO_TIMEOUT
).
intValue
();
public
static
final
String
SO_LINGER_PROP
=
"fr.dyade.aaa.jndi2.socketLinger"
;
/**
* Enable SO_LINGER with the specified linger time in seconds, if the
* value is less than 0 then it disables SO_LINGER. Default value is -1.
*/
private
static
int
socketLinger
=
Configuration
.
getInteger
(
SO_LINGER_PROP
,
-
1
).
intValue
();
private
Socket
socket
;
...
...
@@ -72,7 +79,8 @@ public class IOControl {
this
.
socket
=
socket
;
socket
.
setTcpNoDelay
(
true
);
socket
.
setSoTimeout
(
socketTimeOut
);
socket
.
setSoLinger
(
true
,
1000
);
if
(
socketLinger
>
0
)
socket
.
setSoLinger
(
true
,
socketLinger
);
nos
=
new
NetOutputStream
(
socket
);
bis
=
new
BufferedInputStream
(
socket
.
getInputStream
());
}
...
...
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