Skip to content
New issue

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

Connection problem after setting wifi enabled #14

Open
ferencmd opened this issue Jan 12, 2018 · 3 comments
Open

Connection problem after setting wifi enabled #14

ferencmd opened this issue Jan 12, 2018 · 3 comments

Comments

@ferencmd
Copy link

Hello,

I have the following problem.
If I start my application on an android smart phone when wifi is off then it cannot connect to the shared folder and it is OK. But if I turn on the wifi without restarting my app then it also cannot connect, the exception is the same as when wifi is off. I tried to call these ones but didn't help:
SmbFile.Initialize();
SmbTransport.ClearCachedConnections();
SmbSession.ClearCachedConnections();
SmbTransport.ClearCachedConnections(true);

What can I do in this case?

(If I start my app when wifi is on then all things work. After turning it off then things don't work and it is OK and after turning it on again then things work again.)

@ume05rw
Copy link
Owner

ume05rw commented Jan 13, 2018

Thanks for telling!
Please give me some time.
Perhaps Two weeks later, I can test it.

@ume05rw
Copy link
Owner

ume05rw commented Feb 4, 2018

Sorry I made you wait.

Although it was not completely solved, a hint was found.
If there are multiple I / Fs in the OS (= multiple IP addresses are assigned), you may not be able to select the I / F for accessing the target share correctly.

Please try it:

SharpCifs.Config.SetProperty("jcifs.smb.client.laddr", "[device's IP Address ]");
SmbFile.Initialize();
...connect and mroe.

@ume05rw
Copy link
Owner

ume05rw commented Feb 10, 2018

I released a new version, 2.12.
if client.laddr is not specified, It uses IPAddress.Any.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants