Skip to content

Commit

Permalink
improve netconf connection (#596)
Browse files Browse the repository at this point in the history
* improve netconf connection
---------

Co-authored-by: Christoph Schneider | GIP <[email protected]>
  • Loading branch information
csc-gip and csc-gip authored Dec 4, 2023
1 parent 2a92378 commit d3c2dde
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion modules/xact/connection/ssh/application.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* limitations under the License.
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-->
<Application applicationName="SSH" comment="" factoryVersion="" versionName="2.0.25" xmlVersion="1.1">
<Application applicationName="SSH" comment="" factoryVersion="" versionName="2.0.26" xmlVersion="1.1">
<ApplicationInfo>
<Description Lang="DE">SSH Connections (NETCONF, Shell), Management, SFTP, SharedLibs, SFTPTrigger</Description>
<Description Lang="EN">SSH connections (NETCONF, Shell), management, SFTP, sharedLibs, SFTPTrigger</Description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ public Socket createSocket() throws IOException {
s = new Socket();
}
s.setKeepAlive(true);
s.setTcpNoDelay(true);
return s;
}

Expand Down Expand Up @@ -346,6 +347,7 @@ public Socket createSocket(InetAddress address, int port, InetAddress localAddre
// Client uses only socketFactory.createSocket(), sub-method will not have an effect!
private void connectSocket(Socket s, InetSocketAddress host) throws IOException {
s.setKeepAlive(true);
s.setTcpNoDelay(true);
if (connectionTimeout > 0) {
s.connect(host, connectionTimeout);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import xact.connection.ManagedConnection;
import xact.connection.ReadTimeout;
import xact.connection.SendParameter;
import xact.ssh.SSHMessagePayload;
import xact.ssh.SSHNETCONFConnection;
import xact.ssh.SSHNETCONFConnectionInstanceOperation;
import xact.ssh.SSHNETCONFConnectionSuperProxy;
Expand Down Expand Up @@ -164,11 +165,20 @@ private void readObject(java.io.ObjectInputStream s) throws java.io.IOException,
s.defaultReadObject();
}


@Override
protected ProtocolMessage createPartialProtocolMessage(String content) {
return null;
ProtocolMessage msg = new ProtocolMessage();
msg.setPayload(new SSHMessagePayload(content));
msg.setProtocolAdapterName("SSHNETCONFConnection");
msg.setProtocolName("NETCONF");
return msg;
}

@Override
protected void write(byte[] bytes) throws IOException {
getOutputStream().write(bytes);
getOutputStream().flush();
}

@Override
public List<? extends Capability> getAllCapabilities() {
Expand Down
2 changes: 1 addition & 1 deletion modules/xact/ssh/file/application.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<RuntimeContextRequirements>
<RuntimeContextRequirement>
<ApplicationName>SSH</ApplicationName>
<VersionName>2.0.25</VersionName>
<VersionName>2.0.26</VersionName>
</RuntimeContextRequirement>
<RuntimeContextRequirement>
<ApplicationName>FileMgmt</ApplicationName>
Expand Down

0 comments on commit d3c2dde

Please sign in to comment.