We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
com.hierynomus.smbj.common.SMBRuntimeException: java.util.concurrent.TimeoutException: Timeout expired
I am trying to write a file to SMBJ Server aand I am getting the above error
I have used this to build the connection
SmbConfig config = SmbConfig.builder().withDfsEnabled(true).withTimeout(240L, TimeUnit.SECONDS).withSoTimeout(60L, TimeUnit.SECONDS).build(); SMBClient client = new SMBClient(config); Connection connection = client.connect(smbServer); AuthenticationContext authContext = new AuthenticationContext(username, password.toCharArray(), domain); Session session = connection.authenticate(authContext); DiskShare share = (DiskShare) session.connectShare("ShareName");
Set accessMask = new HashSet(EnumSet.of(AccessMask.FILE_ADD_FILE)); SMB2CreateDisposition createDisposition = SMB2CreateDisposition.FILE_CREATE; Set createOptions = new HashSet(EnumSet.of(SMB2CreateOptions.FILE_NON_DIRECTORY_FILE, SMB2CreateOptions.FILE_WRITE_THROUGH)); remoteFile = share.openFile(remoteFilePath, accessMask, null, SMB2ShareAccess.ALL, createDisposition, createOptions); long fileOffset=0; byte[] buffer = new byte[1024]; int bytesRead; while ((bytesRead = is.read(buffer)) != -1) { remoteFile.write(buffer, fileOffset, 0, bytesRead); fileOffset+=bytesRead; } remoteFile.flush(); remoteFile.close();
I am using 0.10.0 version Jar File Libarary
Could you please help me identify what could be the cause of the issue
The text was updated successfully, but these errors were encountered:
No branches or pull requests
com.hierynomus.smbj.common.SMBRuntimeException: java.util.concurrent.TimeoutException: Timeout expired
I am trying to write a file to SMBJ Server aand I am getting the above error
I have used this to build the connection
Set accessMask = new HashSet(EnumSet.of(AccessMask.FILE_ADD_FILE));
SMB2CreateDisposition createDisposition = SMB2CreateDisposition.FILE_CREATE;
Set createOptions = new HashSet(EnumSet.of(SMB2CreateOptions.FILE_NON_DIRECTORY_FILE, SMB2CreateOptions.FILE_WRITE_THROUGH));
remoteFile = share.openFile(remoteFilePath, accessMask, null, SMB2ShareAccess.ALL, createDisposition, createOptions);
long fileOffset=0;
byte[] buffer = new byte[1024];
int bytesRead;
while ((bytesRead = is.read(buffer)) != -1) {
remoteFile.write(buffer, fileOffset, 0, bytesRead);
fileOffset+=bytesRead;
}
remoteFile.flush();
remoteFile.close();
I am using 0.10.0 version Jar File Libarary
Could you please help me identify what could be the cause of the issue
The text was updated successfully, but these errors were encountered: