Added CSharp example for multi-threaded TLS server. Refactor to separate the ssl and ctx handles.

This commit is contained in:
David Garske
2020-03-19 12:56:19 -07:00
parent a28fc5e70b
commit a8f2c97e13
16 changed files with 631 additions and 124 deletions

View File

@@ -28,7 +28,7 @@ using System.Net;
using System.Net.Sockets;
using wolfSSL.CSharp;
public class wolfSSL_TLS_CSHarp
public class wolfSSL_TLS_Client
{
/// <summary>
/// Example of a logging function
@@ -163,7 +163,7 @@ public class wolfSSL_TLS_CSHarp
if (wolfssl.set_fd(ssl, tcp) != wolfssl.SUCCESS)
{
/* get and print out the error */
Console.Write(wolfssl.get_error(ssl));
Console.WriteLine(wolfssl.get_error(ssl));
tcp.Close();
clean(ssl, ctx);
return;
@@ -174,7 +174,7 @@ public class wolfSSL_TLS_CSHarp
if (wolfssl.connect(ssl) != wolfssl.SUCCESS)
{
/* get and print out the error */
Console.Write(wolfssl.get_error(ssl));
Console.WriteLine(wolfssl.get_error(ssl));
tcp.Close();
clean(ssl, ctx);
return;

View File

@@ -7,7 +7,7 @@
<ProjectGuid>{B9DF2972-38F6-4B42-B228-E3C1A47DF8E8}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>wolfSSL_TLS_CSharp</RootNamespace>
<RootNamespace>wolfSSL_TLS_Client</RootNamespace>
<AssemblyName>wolfSSL-TLS-Client</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>