Skip to content

Commit a4fa2db

Browse files
committed
2 parents 338679c + 042cd03 commit a4fa2db

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

README.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ NuGet https://www.nuget.org/packages/Network/ <br />
1212

1313
# Supported Frameworks
1414

15-
- .NET Framework >= 4.5
15+
- .NET Framework >= 4.6
1616
- .NET Core* >= 2.0
1717
- Mono* >= 5.4
1818
- Xamarin.iOS* >= 10.14
1919
- Xamarin.MAC* >= 3.8
2020
- Xamarin.Android* >= 8.0
2121
- UWP* >= 10.0.16299
2222

23-
'*' No Bluetooth and RSA support
23+
'*' No Bluetooth support
2424

2525
# Example Client
2626
```c#
@@ -163,7 +163,33 @@ NuGet https://www.nuget.org/packages/Network/ <br />
163163
bluetoothConnection.Item2.Send(new CalculationRequest(10, 10), this);
164164
}
165165
```
166+
167+
# RSA Example
168+
```c#
169+
public async void Demo()
170+
{
171+
//1. Retrieve public key
172+
string publicKey = File.ReadAllText("PublicKey.xml");
173+
//2. Retrieve private key
174+
string privateKey = File.ReadAllText("PrivateKey.xml");
175+
//3. Establish a connection.
176+
ClientConnectionContainer container = ConnectionFactory.CreateSecureClientConnectionContainer("127.0.0.1", 1234, publicKey, privateKey);
177+
//4. Register what happens if we get a connection
178+
container.ConnectionEstablished += (connection, type) =>
179+
{
180+
Console.WriteLine($"{type.ToString()} Connection established");
181+
//5. Register what happens if we receive a packet of type "CalculationResponse"
182+
connection.RegisterPacketHandler<CalculationResponse>((response, con) => Console.WriteLine($"Answer received {response.Result}"), this);
183+
//6. Send a calculation request.
184+
connection.Send(new CalculationRequest(10, 10), this);
185+
};
186+
}
187+
```
166188

167189
# Logging
168190

169191
<img src="http://www.indie-dev.at/wp-content/uploads/2016/11/Logging.gif" />
192+
193+
# Logging with RSA
194+
195+
<img src="https://www.indie-dev.at/wp-content/uploads/2018/08/RSA.gif" />

0 commit comments

Comments
 (0)