Comments (19)
Thank you. Just let me know when it will be ready :)
from network.
the new version has a different error even on default key lenth
network.log
here is a log
from network.
- Are the private/public keys correct for each kind?
- Is the communication working without RSA?
- Make sure the firewall isn't blocking the connections
Since the GitHub example doesn't throw any exception and the provided stacktrace doesn't help either, I would require a small sample project illustrating the issue.
from network.
Here is some other info:
- The communication is working without RSA.
- The key lenght of RSA is 512 bits (I know, it's less secure than 2048 bits but it's alright for our purpose)
- The server is use in a windows service application.
- The client is on a xamarin android application with android 6.0 +
I will try to make a small project that illustrate the issue. :)
from network.
An example is required to reconstruct your issue.
Did you try the RSA approach with the default RSA key size? (Just leave it empty so the overloading will take care of it)
from network.
Here is a link for a demo project. Don't forget to change ip address in Program.cs of the ClientTest project. The main solution file is in the ServerTest folder. I try with 512 and 1024 key size and the issue is there. With 2048 key size, there is no issue.
http://sjs-studio.com/temp/CrashTaskCancel.zip
from network.
Thanks. Please stick with the 2048 key size as long as there isn't a new NuGet available. Will invest and fix within the next two weeks.
Thanks for your understanding
from network.
Is there any update on that? i have a simular issiue
from network.
Sorry, not yet. I will investigate that isse as soon as possible. I will raise the priority.
from network.
Issue has been resolved.
Improvements
- Server and Client may choose an arbitrary key size, they can, but don't have to match.
As an example: Only the client sends highly sensitive data and the server only acknowledges.
Server -> Client: 512 keySize
Client -> Server: 4096 keySize - Invalid key sizes (e.g.: 256) will throw an exception immediately.
- The lib will log performance issues, if the keySize has been chosen too secure
- Small refactorings as well
Please let me know if the release works for you. Thanks
from network.
ok, thanks for the feedback. I will take the current version down from NuGet. Just in case
Does this behavior reproduce on the example RSA project on your machine? Furthermore
- On which OS do you use the lib
- On which OS version
- Does your project target .NET or .NET Core?
- Did you update the client and server application?
Regarding your logs:
- The UDP connection shuts down, because of the failed TCP connection. That works like intended
- The TCP connection successfully exchanges RSA keys, then crashes. Unluckily "System.Collections.Generic.KeyNotFoundException: Dany klucz nie był obecny w słowniku." could be related to your code as well. However, I will upload a small change (to log an incoming package before invoking it's delegate) so we will be able to tell which packet causes the issue. Could you please download the src, execute your program again and reupload the exception? That would already help a lot. Thanks in advance.
from network.
Client Android 6.0 xamarin forms app
Server Winforms app on win 10
here is a log from the new ver
network.log
i noticed that when switching pages in the app the client reconnects now but it still crashes this dosent happen on plain text connection
from network.
The new exception log seems to be different from the first one, which is odd.
My first guess is the unsupported RSA OAE Padding on Android 6.0.
Could you please re-try the same scenario with the newest SRC commit?
In the meanwhile I will install Xamarin on my machine to reproduce your issue.
from network.
ok now it creates udp connection for rsa as well
here is a new log
network.log
from network.
I have setup the same environment on my machine.
Without UDP is seems to work fine. Somehow the UDP connection instantly closes after sending data over RSA. Still investigating.
from network.
ok seems like the firewall was to blame on the last error here is a new one
network.log
from network.
Now we receive the exact same error :) At least something. Thanks for the report. I will let you know when it has been fixed.
from network.
Try the code out on your device, instead within the emulator.
The RSA communication does work while it runs on a device, but will fail in the emulator.
(Might be related to: https://xamarin.github.io/bugzilla-archives/21/2162/bug.html)
Please let me know if it also works for you on the device.
from network.
Uppon further investigation the issue arrives from the Android Emulator environment.
There are several open issues on Xamarin regarding unreceivable UDP packets.
Till the issue has been fixed from Xamarin, avoid using UDP within the emulator, or simply deploy the application to your device for testing. This applies for the ClientConnectionContainer and the SecureClientConnectionContainer.
New version has been published to NuGet. (x.x.x.18)
If you encounter another issue, please open a new ticket, since the original "keySize" related one has been fixed.
Thanks for your help
Edit: Make sure to enable multicast on your router, in order to receive udp packets
from network.
Related Issues (20)
- Crashing if variables on connection event.
- Static strings cause crashes
- WritePacketThreadException with Unity build on android HOT 9
- Problem when sending a packet from server to client HOT 5
- Can this library send and receive structs ? HOT 2
- Calling ServerConnectionContainer.Stop or ServerConnectionContainer.StopTcpListener() Throws an Exception HOT 1
- Cannot communicate withe IPv4 address HOT 4
- Using Network with mono HOT 4
- A Task was cancelled HOT 7
- license usage within closed source commercial game HOT 1
- not sure what i'm missing when using the registerstaticpacket handler HOT 1
- Connection closes with the reason "AssemblyDoesNotExist" after sending custom packets
- AssemblyDoesNotExist when sending strings HOT 2
- Unnecessary dependency Microsoft.CSharp HOT 1
- System.IO.EndOfStreamException: 'Unable to read beyond the end of the stream.' HOT 1
- Classes in packets get instantiated as the parent variable Type rather than the Type they were initially when being sent
- Connection closed event not raised when connection times out
- Packet handler in Client is not called after reconnecting
- possible infinite loop problem at runtime HOT 1
- Structs are unsupported
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from network.