diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 0000000..3a48313 --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,29 @@ + + + + $(SolutionDir) + $(SolutionDir)Bin + $(SolutionDir)Source Code + $(SolutionDir)Resource\Icon + $(SolutionDir)Resource + + $(SolutionDir)Resource\3rdLib + $(SolutionDir)Bin\Publish\$(MSBuildProjectName) + $(SolutionDir)Resource\Build Support\CSProj Import + $(SolutionDir)Bin\$(Configuration)\Modules + $(SolutionDir)Bin\$(Configuration)\Libs + $(SolutionDir)Bin\$(Configuration)\$(MSBuildProjectName) + "$(SolutionDir)Resource\Build Support\Tools\Packing Tool\Packing Tool.exe" + $(SolutionDir)Bin\$(Configuration)\Libs\$(MSBuildProjectName) + $(SolutionDir)Bin\$(Configuration)\Modules\$(MSBuildProjectName) + + + $(BinDir)\#Build#\$(MSBuildProjectName) + false + AnyCPU;x64;x86 + NETCore + + + $(ExeOutputDir) + + \ No newline at end of file diff --git a/Directory.Build.targets b/Directory.Build.targets new file mode 100644 index 0000000..af8dfad --- /dev/null +++ b/Directory.Build.targets @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Icon.png b/Icon.png new file mode 100644 index 0000000..683dac5 Binary files /dev/null and b/Icon.png differ diff --git a/Icon.psd b/Icon.psd new file mode 100644 index 0000000..791cc83 Binary files /dev/null and b/Icon.psd differ diff --git a/Mina.Example/Chat/Client/Client.NET.Core.csproj b/Mina.Example/Chat/Client/Client.NET.Core.csproj new file mode 100644 index 0000000..69f5229 --- /dev/null +++ b/Mina.Example/Chat/Client/Client.NET.Core.csproj @@ -0,0 +1,9 @@ + + + + WinExe + net5.0-windows + true + + + diff --git a/Mina.Example/Chat/Client/FormChat.Designer.cs b/Mina.Example/Chat/Client/FormChat.Designer.cs index 2297586..f3be4c1 100644 --- a/Mina.Example/Chat/Client/FormChat.Designer.cs +++ b/Mina.Example/Chat/Client/FormChat.Designer.cs @@ -64,20 +64,22 @@ private void InitializeComponent() this.tableLayoutPanel1.Controls.Add(this.panel1, 5, 1); this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); + this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(4); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 3; - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 42F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F)); - this.tableLayoutPanel1.Size = new System.Drawing.Size(464, 282); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 42F)); + this.tableLayoutPanel1.Size = new System.Drawing.Size(541, 400); this.tableLayoutPanel1.TabIndex = 0; // // buttonSend // this.buttonSend.Dock = System.Windows.Forms.DockStyle.Fill; - this.buttonSend.Location = new System.Drawing.Point(391, 255); + this.buttonSend.Location = new System.Drawing.Point(456, 362); + this.buttonSend.Margin = new System.Windows.Forms.Padding(4); this.buttonSend.Name = "buttonSend"; - this.buttonSend.Size = new System.Drawing.Size(70, 24); + this.buttonSend.Size = new System.Drawing.Size(81, 34); this.buttonSend.TabIndex = 7; this.buttonSend.Text = "Send"; this.buttonSend.UseVisualStyleBackColor = true; @@ -89,9 +91,10 @@ private void InitializeComponent() | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(3, 0); + this.label1.Location = new System.Drawing.Point(4, 0); + this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(68, 30); + this.label1.Size = new System.Drawing.Size(78, 42); this.label1.TabIndex = 0; this.label1.Text = "Name:"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -100,9 +103,10 @@ private void InitializeComponent() // this.tableLayoutPanel1.SetColumnSpan(this.textBoxUser, 2); this.textBoxUser.Dock = System.Windows.Forms.DockStyle.Fill; - this.textBoxUser.Location = new System.Drawing.Point(77, 3); + this.textBoxUser.Location = new System.Drawing.Point(90, 4); + this.textBoxUser.Margin = new System.Windows.Forms.Padding(4); this.textBoxUser.Name = "textBoxUser"; - this.textBoxUser.Size = new System.Drawing.Size(151, 21); + this.textBoxUser.Size = new System.Drawing.Size(175, 23); this.textBoxUser.TabIndex = 1; // // label2 @@ -111,9 +115,10 @@ private void InitializeComponent() | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(234, 0); + this.label2.Location = new System.Drawing.Point(273, 0); + this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(68, 30); + this.label2.Size = new System.Drawing.Size(78, 42); this.label2.TabIndex = 2; this.label2.Text = "Server:"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -122,9 +127,10 @@ private void InitializeComponent() // this.tableLayoutPanel1.SetColumnSpan(this.textBoxServer, 2); this.textBoxServer.Dock = System.Windows.Forms.DockStyle.Fill; - this.textBoxServer.Location = new System.Drawing.Point(308, 3); + this.textBoxServer.Location = new System.Drawing.Point(359, 4); + this.textBoxServer.Margin = new System.Windows.Forms.Padding(4); this.textBoxServer.Name = "textBoxServer"; - this.textBoxServer.Size = new System.Drawing.Size(153, 21); + this.textBoxServer.Size = new System.Drawing.Size(178, 23); this.textBoxServer.TabIndex = 3; this.textBoxServer.Text = "127.0.0.1:1234"; // @@ -132,19 +138,21 @@ private void InitializeComponent() // this.tableLayoutPanel1.SetColumnSpan(this.textBoxChat, 5); this.textBoxChat.Dock = System.Windows.Forms.DockStyle.Fill; - this.textBoxChat.Location = new System.Drawing.Point(3, 33); + this.textBoxChat.Location = new System.Drawing.Point(4, 46); + this.textBoxChat.Margin = new System.Windows.Forms.Padding(4); this.textBoxChat.Multiline = true; this.textBoxChat.Name = "textBoxChat"; - this.textBoxChat.Size = new System.Drawing.Size(382, 216); + this.textBoxChat.Size = new System.Drawing.Size(444, 308); this.textBoxChat.TabIndex = 4; // // textBoxInput // this.tableLayoutPanel1.SetColumnSpan(this.textBoxInput, 5); this.textBoxInput.Dock = System.Windows.Forms.DockStyle.Fill; - this.textBoxInput.Location = new System.Drawing.Point(3, 255); + this.textBoxInput.Location = new System.Drawing.Point(4, 362); + this.textBoxInput.Margin = new System.Windows.Forms.Padding(4); this.textBoxInput.Name = "textBoxInput"; - this.textBoxInput.Size = new System.Drawing.Size(382, 21); + this.textBoxInput.Size = new System.Drawing.Size(444, 23); this.textBoxInput.TabIndex = 5; // // panel1 @@ -154,17 +162,19 @@ private void InitializeComponent() this.panel1.Controls.Add(this.buttonConnect); this.panel1.Controls.Add(this.checkBoxSSL); this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.panel1.Location = new System.Drawing.Point(391, 33); + this.panel1.Location = new System.Drawing.Point(456, 46); + this.panel1.Margin = new System.Windows.Forms.Padding(4); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(70, 216); + this.panel1.Size = new System.Drawing.Size(81, 308); this.panel1.TabIndex = 6; // // buttonQuit // this.buttonQuit.Dock = System.Windows.Forms.DockStyle.Top; - this.buttonQuit.Location = new System.Drawing.Point(0, 62); + this.buttonQuit.Location = new System.Drawing.Point(0, 87); + this.buttonQuit.Margin = new System.Windows.Forms.Padding(4); this.buttonQuit.Name = "buttonQuit"; - this.buttonQuit.Size = new System.Drawing.Size(70, 23); + this.buttonQuit.Size = new System.Drawing.Size(81, 33); this.buttonQuit.TabIndex = 7; this.buttonQuit.Text = "Quit"; this.buttonQuit.UseVisualStyleBackColor = true; @@ -173,9 +183,10 @@ private void InitializeComponent() // buttonDisconnect // this.buttonDisconnect.Dock = System.Windows.Forms.DockStyle.Top; - this.buttonDisconnect.Location = new System.Drawing.Point(0, 39); + this.buttonDisconnect.Location = new System.Drawing.Point(0, 54); + this.buttonDisconnect.Margin = new System.Windows.Forms.Padding(4); this.buttonDisconnect.Name = "buttonDisconnect"; - this.buttonDisconnect.Size = new System.Drawing.Size(70, 23); + this.buttonDisconnect.Size = new System.Drawing.Size(81, 33); this.buttonDisconnect.TabIndex = 6; this.buttonDisconnect.Text = "Close"; this.buttonDisconnect.UseVisualStyleBackColor = true; @@ -184,9 +195,10 @@ private void InitializeComponent() // buttonConnect // this.buttonConnect.Dock = System.Windows.Forms.DockStyle.Top; - this.buttonConnect.Location = new System.Drawing.Point(0, 16); + this.buttonConnect.Location = new System.Drawing.Point(0, 21); + this.buttonConnect.Margin = new System.Windows.Forms.Padding(4); this.buttonConnect.Name = "buttonConnect"; - this.buttonConnect.Size = new System.Drawing.Size(70, 23); + this.buttonConnect.Size = new System.Drawing.Size(81, 33); this.buttonConnect.TabIndex = 4; this.buttonConnect.Text = "Connect"; this.buttonConnect.UseVisualStyleBackColor = true; @@ -197,18 +209,20 @@ private void InitializeComponent() this.checkBoxSSL.AutoSize = true; this.checkBoxSSL.Dock = System.Windows.Forms.DockStyle.Top; this.checkBoxSSL.Location = new System.Drawing.Point(0, 0); + this.checkBoxSSL.Margin = new System.Windows.Forms.Padding(4); this.checkBoxSSL.Name = "checkBoxSSL"; - this.checkBoxSSL.Size = new System.Drawing.Size(70, 16); + this.checkBoxSSL.Size = new System.Drawing.Size(81, 21); this.checkBoxSSL.TabIndex = 3; this.checkBoxSSL.Text = "SSL"; this.checkBoxSSL.UseVisualStyleBackColor = true; // // FormChat // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(464, 282); + this.ClientSize = new System.Drawing.Size(541, 400); this.Controls.Add(this.tableLayoutPanel1); + this.Margin = new System.Windows.Forms.Padding(4); this.Name = "FormChat"; this.Text = "Chat"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormChat_FormClosing); diff --git a/Mina.Example/Chat/Server/Server.NET.Core.csproj b/Mina.Example/Chat/Server/Server.NET.Core.csproj new file mode 100644 index 0000000..98fa6bb --- /dev/null +++ b/Mina.Example/Chat/Server/Server.NET.Core.csproj @@ -0,0 +1,14 @@ + + + + Exe + net5.0 + + + + + PreserveNewest + + + + diff --git a/Mina.Example/EchoServer/EchoServer.NET.Core.csproj b/Mina.Example/EchoServer/EchoServer.NET.Core.csproj new file mode 100644 index 0000000..59804b0 --- /dev/null +++ b/Mina.Example/EchoServer/EchoServer.NET.Core.csproj @@ -0,0 +1,8 @@ + + + + Exe + net5.0 + + + diff --git a/Mina.Example/GettingStarted/SerialShell/SerialShell.NET.Core.csproj b/Mina.Example/GettingStarted/SerialShell/SerialShell.NET.Core.csproj new file mode 100644 index 0000000..59804b0 --- /dev/null +++ b/Mina.Example/GettingStarted/SerialShell/SerialShell.NET.Core.csproj @@ -0,0 +1,8 @@ + + + + Exe + net5.0 + + + diff --git a/Mina.Example/GettingStarted/TimeServer/TimeServer.NET.Core.csproj b/Mina.Example/GettingStarted/TimeServer/TimeServer.NET.Core.csproj new file mode 100644 index 0000000..59804b0 --- /dev/null +++ b/Mina.Example/GettingStarted/TimeServer/TimeServer.NET.Core.csproj @@ -0,0 +1,8 @@ + + + + Exe + net5.0 + + + diff --git a/Mina.Example/Haiku/Haiku.NET.Core.csproj b/Mina.Example/Haiku/Haiku.NET.Core.csproj new file mode 100644 index 0000000..59804b0 --- /dev/null +++ b/Mina.Example/Haiku/Haiku.NET.Core.csproj @@ -0,0 +1,8 @@ + + + + Exe + net5.0 + + + diff --git a/Mina.Example/MulticastUDP/MulticastUDP.NET.Core.csproj b/Mina.Example/MulticastUDP/MulticastUDP.NET.Core.csproj new file mode 100644 index 0000000..59804b0 --- /dev/null +++ b/Mina.Example/MulticastUDP/MulticastUDP.NET.Core.csproj @@ -0,0 +1,8 @@ + + + + Exe + net5.0 + + + diff --git a/Mina.Example/NetCat/NetCat.NET.Core.csproj b/Mina.Example/NetCat/NetCat.NET.Core.csproj new file mode 100644 index 0000000..59804b0 --- /dev/null +++ b/Mina.Example/NetCat/NetCat.NET.Core.csproj @@ -0,0 +1,8 @@ + + + + Exe + net5.0 + + + diff --git a/Mina.Example/Reverser/Reverser.NET.Core.csproj b/Mina.Example/Reverser/Reverser.NET.Core.csproj new file mode 100644 index 0000000..59804b0 --- /dev/null +++ b/Mina.Example/Reverser/Reverser.NET.Core.csproj @@ -0,0 +1,8 @@ + + + + Exe + net5.0 + + + diff --git a/Mina.Example/SumUp/SumUp.NET.Core.csproj b/Mina.Example/SumUp/SumUp.NET.Core.csproj new file mode 100644 index 0000000..2a46cdb --- /dev/null +++ b/Mina.Example/SumUp/SumUp.NET.Core.csproj @@ -0,0 +1,9 @@ + + + + Exe + net5.0 + Mina.Example.SumUp.Client + + + diff --git a/Mina.Example/Tennis/Tennis.NET.Core.csproj b/Mina.Example/Tennis/Tennis.NET.Core.csproj new file mode 100644 index 0000000..59804b0 --- /dev/null +++ b/Mina.Example/Tennis/Tennis.NET.Core.csproj @@ -0,0 +1,8 @@ + + + + Exe + net5.0 + + + diff --git a/Mina.Example/Udp/Udp.NET.Core.csproj b/Mina.Example/Udp/Udp.NET.Core.csproj new file mode 100644 index 0000000..cbd9450 --- /dev/null +++ b/Mina.Example/Udp/Udp.NET.Core.csproj @@ -0,0 +1,9 @@ + + + + Exe + net5.0 + Mina.Example.Udp.MemoryMonitor + + + diff --git a/Mina.NET.Core.sln b/Mina.NET.Core.sln new file mode 100644 index 0000000..cf3b070 --- /dev/null +++ b/Mina.NET.Core.sln @@ -0,0 +1,248 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30204.135 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mina.NET.Core", "Mina.NET\Mina.NET.Core.csproj", "{64BD2695-9905-47FC-8893-0CC96AEDF90D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Example", "Example", "{46FA3607-7BFD-443E-90C2-D6C58CE23CCB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Udp.NET.Core", "Mina.Example\Udp\Udp.NET.Core.csproj", "{4F8A9113-42ED-471F-AB2B-EA8E993EFD76}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tennis.NET.Core", "Mina.Example\Tennis\Tennis.NET.Core.csproj", "{7D9B5914-5D53-437B-B73D-01EA6AFBAB0A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SumUp.NET.Core", "Mina.Example\SumUp\SumUp.NET.Core.csproj", "{48D9133C-FEAE-4385-8897-BBA5A2D11FB2}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Reverser.NET.Core", "Mina.Example\Reverser\Reverser.NET.Core.csproj", "{55B1A41F-45E5-49AA-8142-DD9027C2AEDB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetCat.NET.Core", "Mina.Example\NetCat\NetCat.NET.Core.csproj", "{FE9A6BF3-99B9-4176-B241-7B4B5BD569F5}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MulticastUDP.NET.Core", "Mina.Example\MulticastUDP\MulticastUDP.NET.Core.csproj", "{4E4653C6-8D5A-48A4-86D7-661C949BD9BC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Haiku.NET.Core", "Mina.Example\Haiku\Haiku.NET.Core.csproj", "{2A5394D2-0929-49CE-9185-791CA641C5D7}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EchoServer.NET.Core", "Mina.Example\EchoServer\EchoServer.NET.Core.csproj", "{722BC1A0-35C3-4067-AAC9-5581413AF65D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GettingStarted", "GettingStarted", "{FAA9AA9A-6AE9-4E1B-B6DB-B9B37EC1A95C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TimeServer.NET.Core", "Mina.Example\GettingStarted\TimeServer\TimeServer.NET.Core.csproj", "{DFB709E1-BC33-406E-A86B-C1533C19B13E}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SerialShell.NET.Core", "Mina.Example\GettingStarted\SerialShell\SerialShell.NET.Core.csproj", "{10805663-6284-476A-878F-AD0F97A6CF5E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Chat", "Chat", "{15877AEC-FE61-4D75-B0BB-7CE930A843C7}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Server.NET.Core", "Mina.Example\Chat\Server\Server.NET.Core.csproj", "{3C09D40E-8AE7-4A89-A8AB-FEADDA0859E5}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Client.NET.Core", "Mina.Example\Chat\Client\Client.NET.Core.csproj", "{42092100-5856-4533-A7E4-0685B1F91A73}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mina.NET.Core.Test", "Mina.Test\Mina.NET.Core.Test.csproj", "{F94CCE31-DAF9-4299-B514-1B34DACCB8A6}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{94549169-33A2-439D-8BEC-C62E0B3CED8D}" + ProjectSection(SolutionItems) = preProject + Directory.Build.props = Directory.Build.props + Directory.Build.targets = Directory.Build.targets + ReleaseNotes.csproj.import = ReleaseNotes.csproj.import + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {64BD2695-9905-47FC-8893-0CC96AEDF90D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {64BD2695-9905-47FC-8893-0CC96AEDF90D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {64BD2695-9905-47FC-8893-0CC96AEDF90D}.Debug|x64.ActiveCfg = Debug|x64 + {64BD2695-9905-47FC-8893-0CC96AEDF90D}.Debug|x64.Build.0 = Debug|x64 + {64BD2695-9905-47FC-8893-0CC96AEDF90D}.Debug|x86.ActiveCfg = Debug|x86 + {64BD2695-9905-47FC-8893-0CC96AEDF90D}.Debug|x86.Build.0 = Debug|x86 + {64BD2695-9905-47FC-8893-0CC96AEDF90D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {64BD2695-9905-47FC-8893-0CC96AEDF90D}.Release|Any CPU.Build.0 = Release|Any CPU + {64BD2695-9905-47FC-8893-0CC96AEDF90D}.Release|x64.ActiveCfg = Release|x64 + {64BD2695-9905-47FC-8893-0CC96AEDF90D}.Release|x64.Build.0 = Release|x64 + {64BD2695-9905-47FC-8893-0CC96AEDF90D}.Release|x86.ActiveCfg = Release|x86 + {64BD2695-9905-47FC-8893-0CC96AEDF90D}.Release|x86.Build.0 = Release|x86 + {4F8A9113-42ED-471F-AB2B-EA8E993EFD76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4F8A9113-42ED-471F-AB2B-EA8E993EFD76}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4F8A9113-42ED-471F-AB2B-EA8E993EFD76}.Debug|x64.ActiveCfg = Debug|x64 + {4F8A9113-42ED-471F-AB2B-EA8E993EFD76}.Debug|x64.Build.0 = Debug|x64 + {4F8A9113-42ED-471F-AB2B-EA8E993EFD76}.Debug|x86.ActiveCfg = Debug|x86 + {4F8A9113-42ED-471F-AB2B-EA8E993EFD76}.Debug|x86.Build.0 = Debug|x86 + {4F8A9113-42ED-471F-AB2B-EA8E993EFD76}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4F8A9113-42ED-471F-AB2B-EA8E993EFD76}.Release|Any CPU.Build.0 = Release|Any CPU + {4F8A9113-42ED-471F-AB2B-EA8E993EFD76}.Release|x64.ActiveCfg = Release|x64 + {4F8A9113-42ED-471F-AB2B-EA8E993EFD76}.Release|x64.Build.0 = Release|x64 + {4F8A9113-42ED-471F-AB2B-EA8E993EFD76}.Release|x86.ActiveCfg = Release|x86 + {4F8A9113-42ED-471F-AB2B-EA8E993EFD76}.Release|x86.Build.0 = Release|x86 + {7D9B5914-5D53-437B-B73D-01EA6AFBAB0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7D9B5914-5D53-437B-B73D-01EA6AFBAB0A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7D9B5914-5D53-437B-B73D-01EA6AFBAB0A}.Debug|x64.ActiveCfg = Debug|x64 + {7D9B5914-5D53-437B-B73D-01EA6AFBAB0A}.Debug|x64.Build.0 = Debug|x64 + {7D9B5914-5D53-437B-B73D-01EA6AFBAB0A}.Debug|x86.ActiveCfg = Debug|x86 + {7D9B5914-5D53-437B-B73D-01EA6AFBAB0A}.Debug|x86.Build.0 = Debug|x86 + {7D9B5914-5D53-437B-B73D-01EA6AFBAB0A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7D9B5914-5D53-437B-B73D-01EA6AFBAB0A}.Release|Any CPU.Build.0 = Release|Any CPU + {7D9B5914-5D53-437B-B73D-01EA6AFBAB0A}.Release|x64.ActiveCfg = Release|x64 + {7D9B5914-5D53-437B-B73D-01EA6AFBAB0A}.Release|x64.Build.0 = Release|x64 + {7D9B5914-5D53-437B-B73D-01EA6AFBAB0A}.Release|x86.ActiveCfg = Release|x86 + {7D9B5914-5D53-437B-B73D-01EA6AFBAB0A}.Release|x86.Build.0 = Release|x86 + {48D9133C-FEAE-4385-8897-BBA5A2D11FB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {48D9133C-FEAE-4385-8897-BBA5A2D11FB2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {48D9133C-FEAE-4385-8897-BBA5A2D11FB2}.Debug|x64.ActiveCfg = Debug|x64 + {48D9133C-FEAE-4385-8897-BBA5A2D11FB2}.Debug|x64.Build.0 = Debug|x64 + {48D9133C-FEAE-4385-8897-BBA5A2D11FB2}.Debug|x86.ActiveCfg = Debug|x86 + {48D9133C-FEAE-4385-8897-BBA5A2D11FB2}.Debug|x86.Build.0 = Debug|x86 + {48D9133C-FEAE-4385-8897-BBA5A2D11FB2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {48D9133C-FEAE-4385-8897-BBA5A2D11FB2}.Release|Any CPU.Build.0 = Release|Any CPU + {48D9133C-FEAE-4385-8897-BBA5A2D11FB2}.Release|x64.ActiveCfg = Release|x64 + {48D9133C-FEAE-4385-8897-BBA5A2D11FB2}.Release|x64.Build.0 = Release|x64 + {48D9133C-FEAE-4385-8897-BBA5A2D11FB2}.Release|x86.ActiveCfg = Release|x86 + {48D9133C-FEAE-4385-8897-BBA5A2D11FB2}.Release|x86.Build.0 = Release|x86 + {55B1A41F-45E5-49AA-8142-DD9027C2AEDB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {55B1A41F-45E5-49AA-8142-DD9027C2AEDB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {55B1A41F-45E5-49AA-8142-DD9027C2AEDB}.Debug|x64.ActiveCfg = Debug|x64 + {55B1A41F-45E5-49AA-8142-DD9027C2AEDB}.Debug|x64.Build.0 = Debug|x64 + {55B1A41F-45E5-49AA-8142-DD9027C2AEDB}.Debug|x86.ActiveCfg = Debug|x86 + {55B1A41F-45E5-49AA-8142-DD9027C2AEDB}.Debug|x86.Build.0 = Debug|x86 + {55B1A41F-45E5-49AA-8142-DD9027C2AEDB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {55B1A41F-45E5-49AA-8142-DD9027C2AEDB}.Release|Any CPU.Build.0 = Release|Any CPU + {55B1A41F-45E5-49AA-8142-DD9027C2AEDB}.Release|x64.ActiveCfg = Release|x64 + {55B1A41F-45E5-49AA-8142-DD9027C2AEDB}.Release|x64.Build.0 = Release|x64 + {55B1A41F-45E5-49AA-8142-DD9027C2AEDB}.Release|x86.ActiveCfg = Release|x86 + {55B1A41F-45E5-49AA-8142-DD9027C2AEDB}.Release|x86.Build.0 = Release|x86 + {FE9A6BF3-99B9-4176-B241-7B4B5BD569F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FE9A6BF3-99B9-4176-B241-7B4B5BD569F5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FE9A6BF3-99B9-4176-B241-7B4B5BD569F5}.Debug|x64.ActiveCfg = Debug|x64 + {FE9A6BF3-99B9-4176-B241-7B4B5BD569F5}.Debug|x64.Build.0 = Debug|x64 + {FE9A6BF3-99B9-4176-B241-7B4B5BD569F5}.Debug|x86.ActiveCfg = Debug|x86 + {FE9A6BF3-99B9-4176-B241-7B4B5BD569F5}.Debug|x86.Build.0 = Debug|x86 + {FE9A6BF3-99B9-4176-B241-7B4B5BD569F5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FE9A6BF3-99B9-4176-B241-7B4B5BD569F5}.Release|Any CPU.Build.0 = Release|Any CPU + {FE9A6BF3-99B9-4176-B241-7B4B5BD569F5}.Release|x64.ActiveCfg = Release|x64 + {FE9A6BF3-99B9-4176-B241-7B4B5BD569F5}.Release|x64.Build.0 = Release|x64 + {FE9A6BF3-99B9-4176-B241-7B4B5BD569F5}.Release|x86.ActiveCfg = Release|x86 + {FE9A6BF3-99B9-4176-B241-7B4B5BD569F5}.Release|x86.Build.0 = Release|x86 + {4E4653C6-8D5A-48A4-86D7-661C949BD9BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4E4653C6-8D5A-48A4-86D7-661C949BD9BC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4E4653C6-8D5A-48A4-86D7-661C949BD9BC}.Debug|x64.ActiveCfg = Debug|x64 + {4E4653C6-8D5A-48A4-86D7-661C949BD9BC}.Debug|x64.Build.0 = Debug|x64 + {4E4653C6-8D5A-48A4-86D7-661C949BD9BC}.Debug|x86.ActiveCfg = Debug|x86 + {4E4653C6-8D5A-48A4-86D7-661C949BD9BC}.Debug|x86.Build.0 = Debug|x86 + {4E4653C6-8D5A-48A4-86D7-661C949BD9BC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4E4653C6-8D5A-48A4-86D7-661C949BD9BC}.Release|Any CPU.Build.0 = Release|Any CPU + {4E4653C6-8D5A-48A4-86D7-661C949BD9BC}.Release|x64.ActiveCfg = Release|x64 + {4E4653C6-8D5A-48A4-86D7-661C949BD9BC}.Release|x64.Build.0 = Release|x64 + {4E4653C6-8D5A-48A4-86D7-661C949BD9BC}.Release|x86.ActiveCfg = Release|x86 + {4E4653C6-8D5A-48A4-86D7-661C949BD9BC}.Release|x86.Build.0 = Release|x86 + {2A5394D2-0929-49CE-9185-791CA641C5D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2A5394D2-0929-49CE-9185-791CA641C5D7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2A5394D2-0929-49CE-9185-791CA641C5D7}.Debug|x64.ActiveCfg = Debug|x64 + {2A5394D2-0929-49CE-9185-791CA641C5D7}.Debug|x64.Build.0 = Debug|x64 + {2A5394D2-0929-49CE-9185-791CA641C5D7}.Debug|x86.ActiveCfg = Debug|x86 + {2A5394D2-0929-49CE-9185-791CA641C5D7}.Debug|x86.Build.0 = Debug|x86 + {2A5394D2-0929-49CE-9185-791CA641C5D7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2A5394D2-0929-49CE-9185-791CA641C5D7}.Release|Any CPU.Build.0 = Release|Any CPU + {2A5394D2-0929-49CE-9185-791CA641C5D7}.Release|x64.ActiveCfg = Release|x64 + {2A5394D2-0929-49CE-9185-791CA641C5D7}.Release|x64.Build.0 = Release|x64 + {2A5394D2-0929-49CE-9185-791CA641C5D7}.Release|x86.ActiveCfg = Release|x86 + {2A5394D2-0929-49CE-9185-791CA641C5D7}.Release|x86.Build.0 = Release|x86 + {722BC1A0-35C3-4067-AAC9-5581413AF65D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {722BC1A0-35C3-4067-AAC9-5581413AF65D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {722BC1A0-35C3-4067-AAC9-5581413AF65D}.Debug|x64.ActiveCfg = Debug|x64 + {722BC1A0-35C3-4067-AAC9-5581413AF65D}.Debug|x64.Build.0 = Debug|x64 + {722BC1A0-35C3-4067-AAC9-5581413AF65D}.Debug|x86.ActiveCfg = Debug|x86 + {722BC1A0-35C3-4067-AAC9-5581413AF65D}.Debug|x86.Build.0 = Debug|x86 + {722BC1A0-35C3-4067-AAC9-5581413AF65D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {722BC1A0-35C3-4067-AAC9-5581413AF65D}.Release|Any CPU.Build.0 = Release|Any CPU + {722BC1A0-35C3-4067-AAC9-5581413AF65D}.Release|x64.ActiveCfg = Release|x64 + {722BC1A0-35C3-4067-AAC9-5581413AF65D}.Release|x64.Build.0 = Release|x64 + {722BC1A0-35C3-4067-AAC9-5581413AF65D}.Release|x86.ActiveCfg = Release|x86 + {722BC1A0-35C3-4067-AAC9-5581413AF65D}.Release|x86.Build.0 = Release|x86 + {DFB709E1-BC33-406E-A86B-C1533C19B13E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DFB709E1-BC33-406E-A86B-C1533C19B13E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DFB709E1-BC33-406E-A86B-C1533C19B13E}.Debug|x64.ActiveCfg = Debug|x64 + {DFB709E1-BC33-406E-A86B-C1533C19B13E}.Debug|x64.Build.0 = Debug|x64 + {DFB709E1-BC33-406E-A86B-C1533C19B13E}.Debug|x86.ActiveCfg = Debug|x86 + {DFB709E1-BC33-406E-A86B-C1533C19B13E}.Debug|x86.Build.0 = Debug|x86 + {DFB709E1-BC33-406E-A86B-C1533C19B13E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DFB709E1-BC33-406E-A86B-C1533C19B13E}.Release|Any CPU.Build.0 = Release|Any CPU + {DFB709E1-BC33-406E-A86B-C1533C19B13E}.Release|x64.ActiveCfg = Release|x64 + {DFB709E1-BC33-406E-A86B-C1533C19B13E}.Release|x64.Build.0 = Release|x64 + {DFB709E1-BC33-406E-A86B-C1533C19B13E}.Release|x86.ActiveCfg = Release|x86 + {DFB709E1-BC33-406E-A86B-C1533C19B13E}.Release|x86.Build.0 = Release|x86 + {10805663-6284-476A-878F-AD0F97A6CF5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {10805663-6284-476A-878F-AD0F97A6CF5E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {10805663-6284-476A-878F-AD0F97A6CF5E}.Debug|x64.ActiveCfg = Debug|x64 + {10805663-6284-476A-878F-AD0F97A6CF5E}.Debug|x64.Build.0 = Debug|x64 + {10805663-6284-476A-878F-AD0F97A6CF5E}.Debug|x86.ActiveCfg = Debug|x86 + {10805663-6284-476A-878F-AD0F97A6CF5E}.Debug|x86.Build.0 = Debug|x86 + {10805663-6284-476A-878F-AD0F97A6CF5E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {10805663-6284-476A-878F-AD0F97A6CF5E}.Release|Any CPU.Build.0 = Release|Any CPU + {10805663-6284-476A-878F-AD0F97A6CF5E}.Release|x64.ActiveCfg = Release|x64 + {10805663-6284-476A-878F-AD0F97A6CF5E}.Release|x64.Build.0 = Release|x64 + {10805663-6284-476A-878F-AD0F97A6CF5E}.Release|x86.ActiveCfg = Release|x86 + {10805663-6284-476A-878F-AD0F97A6CF5E}.Release|x86.Build.0 = Release|x86 + {3C09D40E-8AE7-4A89-A8AB-FEADDA0859E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3C09D40E-8AE7-4A89-A8AB-FEADDA0859E5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3C09D40E-8AE7-4A89-A8AB-FEADDA0859E5}.Debug|x64.ActiveCfg = Debug|x64 + {3C09D40E-8AE7-4A89-A8AB-FEADDA0859E5}.Debug|x64.Build.0 = Debug|x64 + {3C09D40E-8AE7-4A89-A8AB-FEADDA0859E5}.Debug|x86.ActiveCfg = Debug|x86 + {3C09D40E-8AE7-4A89-A8AB-FEADDA0859E5}.Debug|x86.Build.0 = Debug|x86 + {3C09D40E-8AE7-4A89-A8AB-FEADDA0859E5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3C09D40E-8AE7-4A89-A8AB-FEADDA0859E5}.Release|Any CPU.Build.0 = Release|Any CPU + {3C09D40E-8AE7-4A89-A8AB-FEADDA0859E5}.Release|x64.ActiveCfg = Release|x64 + {3C09D40E-8AE7-4A89-A8AB-FEADDA0859E5}.Release|x64.Build.0 = Release|x64 + {3C09D40E-8AE7-4A89-A8AB-FEADDA0859E5}.Release|x86.ActiveCfg = Release|x86 + {3C09D40E-8AE7-4A89-A8AB-FEADDA0859E5}.Release|x86.Build.0 = Release|x86 + {42092100-5856-4533-A7E4-0685B1F91A73}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {42092100-5856-4533-A7E4-0685B1F91A73}.Debug|Any CPU.Build.0 = Debug|Any CPU + {42092100-5856-4533-A7E4-0685B1F91A73}.Debug|x64.ActiveCfg = Debug|x64 + {42092100-5856-4533-A7E4-0685B1F91A73}.Debug|x64.Build.0 = Debug|x64 + {42092100-5856-4533-A7E4-0685B1F91A73}.Debug|x86.ActiveCfg = Debug|x86 + {42092100-5856-4533-A7E4-0685B1F91A73}.Debug|x86.Build.0 = Debug|x86 + {42092100-5856-4533-A7E4-0685B1F91A73}.Release|Any CPU.ActiveCfg = Release|Any CPU + {42092100-5856-4533-A7E4-0685B1F91A73}.Release|Any CPU.Build.0 = Release|Any CPU + {42092100-5856-4533-A7E4-0685B1F91A73}.Release|x64.ActiveCfg = Release|x64 + {42092100-5856-4533-A7E4-0685B1F91A73}.Release|x64.Build.0 = Release|x64 + {42092100-5856-4533-A7E4-0685B1F91A73}.Release|x86.ActiveCfg = Release|x86 + {42092100-5856-4533-A7E4-0685B1F91A73}.Release|x86.Build.0 = Release|x86 + {F94CCE31-DAF9-4299-B514-1B34DACCB8A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F94CCE31-DAF9-4299-B514-1B34DACCB8A6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F94CCE31-DAF9-4299-B514-1B34DACCB8A6}.Debug|x64.ActiveCfg = Debug|x64 + {F94CCE31-DAF9-4299-B514-1B34DACCB8A6}.Debug|x64.Build.0 = Debug|x64 + {F94CCE31-DAF9-4299-B514-1B34DACCB8A6}.Debug|x86.ActiveCfg = Debug|x86 + {F94CCE31-DAF9-4299-B514-1B34DACCB8A6}.Debug|x86.Build.0 = Debug|x86 + {F94CCE31-DAF9-4299-B514-1B34DACCB8A6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F94CCE31-DAF9-4299-B514-1B34DACCB8A6}.Release|Any CPU.Build.0 = Release|Any CPU + {F94CCE31-DAF9-4299-B514-1B34DACCB8A6}.Release|x64.ActiveCfg = Release|x64 + {F94CCE31-DAF9-4299-B514-1B34DACCB8A6}.Release|x64.Build.0 = Release|x64 + {F94CCE31-DAF9-4299-B514-1B34DACCB8A6}.Release|x86.ActiveCfg = Release|x86 + {F94CCE31-DAF9-4299-B514-1B34DACCB8A6}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {4F8A9113-42ED-471F-AB2B-EA8E993EFD76} = {46FA3607-7BFD-443E-90C2-D6C58CE23CCB} + {7D9B5914-5D53-437B-B73D-01EA6AFBAB0A} = {46FA3607-7BFD-443E-90C2-D6C58CE23CCB} + {48D9133C-FEAE-4385-8897-BBA5A2D11FB2} = {46FA3607-7BFD-443E-90C2-D6C58CE23CCB} + {55B1A41F-45E5-49AA-8142-DD9027C2AEDB} = {46FA3607-7BFD-443E-90C2-D6C58CE23CCB} + {FE9A6BF3-99B9-4176-B241-7B4B5BD569F5} = {46FA3607-7BFD-443E-90C2-D6C58CE23CCB} + {4E4653C6-8D5A-48A4-86D7-661C949BD9BC} = {46FA3607-7BFD-443E-90C2-D6C58CE23CCB} + {2A5394D2-0929-49CE-9185-791CA641C5D7} = {46FA3607-7BFD-443E-90C2-D6C58CE23CCB} + {722BC1A0-35C3-4067-AAC9-5581413AF65D} = {46FA3607-7BFD-443E-90C2-D6C58CE23CCB} + {FAA9AA9A-6AE9-4E1B-B6DB-B9B37EC1A95C} = {46FA3607-7BFD-443E-90C2-D6C58CE23CCB} + {DFB709E1-BC33-406E-A86B-C1533C19B13E} = {FAA9AA9A-6AE9-4E1B-B6DB-B9B37EC1A95C} + {10805663-6284-476A-878F-AD0F97A6CF5E} = {FAA9AA9A-6AE9-4E1B-B6DB-B9B37EC1A95C} + {15877AEC-FE61-4D75-B0BB-7CE930A843C7} = {46FA3607-7BFD-443E-90C2-D6C58CE23CCB} + {3C09D40E-8AE7-4A89-A8AB-FEADDA0859E5} = {15877AEC-FE61-4D75-B0BB-7CE930A843C7} + {42092100-5856-4533-A7E4-0685B1F91A73} = {15877AEC-FE61-4D75-B0BB-7CE930A843C7} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {28D9CFB5-D963-4C55-8990-8DD345A0E8F8} + EndGlobalSection +EndGlobal diff --git a/Mina.NET/Core/Service/AbstractIoAcceptor.cs b/Mina.NET/Core/Service/AbstractIoAcceptor.cs index ab5621b..c28b1ff 100644 --- a/Mina.NET/Core/Service/AbstractIoAcceptor.cs +++ b/Mina.NET/Core/Service/AbstractIoAcceptor.cs @@ -18,14 +18,16 @@ public abstract class AbstractIoAcceptor : AbstractIoService, IoAcceptor /// /// The lock for binding. /// +#if !NETCore [CLSCompliant(false)] +#endif protected Object _bindLock; /// /// protected AbstractIoAcceptor(IoSessionConfig sessionConfig) : base(sessionConfig) - { + { _bindLock = ((ICollection)_boundEndPoints).SyncRoot; } diff --git a/Mina.NET/Filter/Ssl/SslFilter.cs b/Mina.NET/Filter/Ssl/SslFilter.cs index e904210..538c221 100644 --- a/Mina.NET/Filter/Ssl/SslFilter.cs +++ b/Mina.NET/Filter/Ssl/SslFilter.cs @@ -25,8 +25,12 @@ public class SslFilter : IoFilterAdapter private static readonly AttributeKey NEXT_FILTER = new AttributeKey(typeof(SslFilter), "nextFilter"); private static readonly AttributeKey SSL_HANDLER = new AttributeKey(typeof(SslFilter), "handler"); - X509Certificate _serverCertificate = null; + private readonly X509Certificate _serverCertificate = null; +#if !NETCore SslProtocols _sslProtocol = SslProtocols.Default; +#else + SslProtocols _sslProtocol = SslProtocols.None; +#endif /// /// Creates a new SSL filter using the specified PKCS7 signed file. @@ -174,8 +178,7 @@ public override void MessageReceived(INextFilter nextFilter, IoSession session, /// public override void MessageSent(INextFilter nextFilter, IoSession session, IWriteRequest writeRequest) { - EncryptedWriteRequest encryptedWriteRequest = writeRequest as EncryptedWriteRequest; - if (encryptedWriteRequest == null) + if (!(writeRequest is EncryptedWriteRequest encryptedWriteRequest)) { // ignore extra buffers used for handshaking } @@ -213,17 +216,17 @@ public override void FilterClose(INextFilter nextFilter, IoSession session) IWriteFuture future = null; try { - future = InitiateClosure(handler, nextFilter, session); + future = InitiateClosure(handler, session); future.Complete += (s, e) => base.FilterClose(nextFilter, session); } finally - { + { if (future == null) base.FilterClose(nextFilter, session); } } - private IWriteFuture InitiateClosure(SslHandler handler, INextFilter nextFilter, IoSession session) + private IWriteFuture InitiateClosure(SslHandler handler, IoSession session) { IWriteFuture future = DefaultWriteFuture.NewWrittenFuture(session); handler.Destroy(); @@ -477,8 +480,7 @@ public void MessageReceived(INextFilter nextFilter, IoBuffer buf) public void Destroy() { _sslStream.Close(); - IoFilterEvent scheduledWrite; - while (_preHandshakeEventQueue.TryDequeue(out scheduledWrite)) + while (_preHandshakeEventQueue.TryDequeue(out _)) { } } @@ -486,8 +488,7 @@ private void FlushPreHandshakeEvents() { lock (this) { - IoFilterEvent scheduledWrite; - while (_preHandshakeEventQueue.TryDequeue(out scheduledWrite)) + while (_preHandshakeEventQueue.TryDequeue(out IoFilterEvent scheduledWrite)) { _sslFilter.FilterWrite(scheduledWrite.NextFilter, scheduledWrite.Session, (IWriteRequest)scheduledWrite.Parameter); } diff --git a/Mina.NET/Mina.NET.Core.csproj b/Mina.NET/Mina.NET.Core.csproj new file mode 100644 index 0000000..b9f6241 --- /dev/null +++ b/Mina.NET/Mina.NET.Core.csproj @@ -0,0 +1,66 @@ + + + + + Mina.NET.Core + netstandard2.0 + 2.0.16 + Longshine + Async socket library for high performance and high scalability network applications. + Copyright © Longshine 2013-2022 + $(LibraryOutputDir) + https://github.com/UCan927/Mina.NET + https://github.com/UCan927/Mina.NET + git + Apache-2.0 + Icon.png + async;socket;MINA;Netty;NIO;SocketAsyncEventArgs;.NET Core; + true + mina.snk + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Mina.NET/Transport/Serial/SerialEndPoint.cs b/Mina.NET/Transport/Serial/SerialEndPoint.cs index 95b3273..ead45e9 100644 --- a/Mina.NET/Transport/Serial/SerialEndPoint.cs +++ b/Mina.NET/Transport/Serial/SerialEndPoint.cs @@ -82,6 +82,11 @@ public StopBits StopBits { get { return _stopBits; } } + + public override string ToString() + { + return $"{_portName}:{_baudRate}"; + } } } #endif \ No newline at end of file diff --git a/Mina.NET/Transport/Socket/AsyncDatagramConnector.cs b/Mina.NET/Transport/Socket/AsyncDatagramConnector.cs index 3750cfc..e8ed0f2 100644 --- a/Mina.NET/Transport/Socket/AsyncDatagramConnector.cs +++ b/Mina.NET/Transport/Socket/AsyncDatagramConnector.cs @@ -1,93 +1,93 @@ -using System; -using System.Net.Sockets; -using Mina.Core.Service; - -namespace Mina.Transport.Socket -{ - /// - /// for datagram transport (UDP/IP). - /// - public class AsyncDatagramConnector : AbstractSocketConnector, IDatagramConnector - { - /// - /// Instantiates. - /// - public AsyncDatagramConnector() - : base(new DefaultDatagramSessionConfig()) - { } - - /// - public new IDatagramSessionConfig SessionConfig - { - get { return (IDatagramSessionConfig)base.SessionConfig; } - } - - /// - public override ITransportMetadata TransportMetadata - { - get { return AsyncDatagramSession.Metadata; } - } - - /// - protected override System.Net.Sockets.Socket NewSocket(AddressFamily addressFamily) - { - return new System.Net.Sockets.Socket(addressFamily, SocketType.Dgram, ProtocolType.Udp); - } - - /// - protected override void BeginConnect(ConnectorContext connector) - { - /* - * No idea why get a SocketError.InvalidArgument in ConnectAsync. - * Call BeginConnect instead. - */ - connector.Socket.BeginConnect(connector.RemoteEP, ConnectCallback, connector); - } - - private void ConnectCallback(IAsyncResult ar) - { - ConnectorContext connector = (ConnectorContext)ar.AsyncState; - try - { - connector.Socket.EndConnect(ar); - } - catch (Exception ex) - { - EndConnect(ex, connector); - return; - } - - SocketAsyncEventArgs readBuffer = new SocketAsyncEventArgs(); - readBuffer.SetBuffer(new Byte[SessionConfig.ReadBufferSize], 0, SessionConfig.ReadBufferSize); - readBuffer.Completed += new EventHandler(SocketAsyncEventArgs_Completed); - - SocketAsyncEventArgs writeBuffer = new SocketAsyncEventArgs(); - writeBuffer.SetBuffer(new Byte[SessionConfig.ReadBufferSize], 0, SessionConfig.ReadBufferSize); - writeBuffer.Completed += new EventHandler(SocketAsyncEventArgs_Completed); - +using System; +using System.Net.Sockets; +using Mina.Core.Service; + +namespace Mina.Transport.Socket +{ + /// + /// for datagram transport (UDP/IP). + /// + public class AsyncDatagramConnector : AbstractSocketConnector, IDatagramConnector + { + /// + /// Instantiates. + /// + public AsyncDatagramConnector() + : base(new DefaultDatagramSessionConfig()) + { } + + /// + public new IDatagramSessionConfig SessionConfig + { + get { return (IDatagramSessionConfig)base.SessionConfig; } + } + + /// + public override ITransportMetadata TransportMetadata + { + get { return AsyncDatagramSession.Metadata; } + } + + /// + protected override System.Net.Sockets.Socket NewSocket(AddressFamily addressFamily) + { + return new System.Net.Sockets.Socket(addressFamily, SocketType.Dgram, ProtocolType.Udp); + } + + /// + protected override void BeginConnect(ConnectorContext connector) + { + /* + * No idea why get a SocketError.InvalidArgument in ConnectAsync. + * Call BeginConnect instead. + */ + connector.Socket.BeginConnect(connector.RemoteEP, ConnectCallback, connector); + } + + private void ConnectCallback(IAsyncResult ar) + { + ConnectorContext connector = (ConnectorContext)ar.AsyncState; + try + { + connector.Socket.EndConnect(ar); + } + catch (Exception ex) + { + EndConnect(ex, connector); + return; + } + + SocketAsyncEventArgs readBuffer = new SocketAsyncEventArgs(); + readBuffer.SetBuffer(new Byte[SessionConfig.ReadBufferSize], 0, SessionConfig.ReadBufferSize); + readBuffer.Completed += new EventHandler(SocketAsyncEventArgs_Completed); + + SocketAsyncEventArgs writeBuffer = new SocketAsyncEventArgs(); + writeBuffer.SetBuffer(new Byte[SessionConfig.ReadBufferSize], 0, SessionConfig.ReadBufferSize); + writeBuffer.Completed += new EventHandler(SocketAsyncEventArgs_Completed); + try { EndConnect(new AsyncDatagramSession(this, Processor, connector.Socket, connector.RemoteEP, new SocketAsyncEventArgsBuffer(readBuffer), new SocketAsyncEventArgsBuffer(writeBuffer), ReuseBuffer), connector); - } - catch (Exception ex) - { - Util.ExceptionMonitor.Instance.ExceptionCaught(ex); - } - } - - void SocketAsyncEventArgs_Completed(object sender, SocketAsyncEventArgs e) - { - switch (e.LastOperation) - { - case SocketAsyncOperation.ReceiveFrom: - ((AsyncDatagramSession)e.UserToken).ProcessReceive(e); - break; - case SocketAsyncOperation.SendTo: - ((AsyncDatagramSession)e.UserToken).ProcessSend(e); - break; - } - } - } -} + } + catch (Exception ex) + { + Util.ExceptionMonitor.Instance.ExceptionCaught(ex); + } + } + + void SocketAsyncEventArgs_Completed(object sender, SocketAsyncEventArgs e) + { + switch (e.LastOperation) + { + case SocketAsyncOperation.ReceiveFrom: + ((AsyncDatagramSession)e.UserToken).ProcessReceive(e); + break; + case SocketAsyncOperation.SendTo: + ((AsyncDatagramSession)e.UserToken).ProcessSend(e); + break; + } + } + } +} diff --git a/Mina.NET/Transport/Socket/AsyncDatagramSession.NET40.cs b/Mina.NET/Transport/Socket/AsyncDatagramSession.NET40.cs index e3e8a6c..7bd7725 100644 --- a/Mina.NET/Transport/Socket/AsyncDatagramSession.NET40.cs +++ b/Mina.NET/Transport/Socket/AsyncDatagramSession.NET40.cs @@ -18,7 +18,7 @@ partial class AsyncDatagramSession : SocketSession public AsyncDatagramSession(IoService service, IoProcessor processor, System.Net.Sockets.Socket socket, EndPoint remoteEP, SocketAsyncEventArgsBuffer readBuffer, SocketAsyncEventArgsBuffer writeBuffer, Boolean reuseBuffer) - : base(service, processor, new DatagramSessionConfigImpl(socket), socket, socket.LocalEndPoint, socket.RemoteEndPoint, reuseBuffer) + : base(service, processor, new DatagramSessionConfigImpl(socket), socket, socket.LocalEndPoint, socket.RemoteEndPoint ?? remoteEP, reuseBuffer) { _readBuffer = readBuffer; _readBuffer.SocketAsyncEventArgs.UserToken = this; @@ -110,7 +110,7 @@ protected override void BeginReceive() try { if (_readBuffer.SocketAsyncEventArgs.RemoteEndPoint == null) - _readBuffer.SocketAsyncEventArgs.RemoteEndPoint = Socket.RemoteEndPoint; + _readBuffer.SocketAsyncEventArgs.RemoteEndPoint = Socket.RemoteEndPoint ?? this.RemoteEndPoint; willRaiseEvent = Socket.ReceiveFromAsync(_readBuffer.SocketAsyncEventArgs); } diff --git a/Mina.Test/Mina.NET.Core.Test.csproj b/Mina.Test/Mina.NET.Core.Test.csproj new file mode 100644 index 0000000..bcaefa1 --- /dev/null +++ b/Mina.Test/Mina.NET.Core.Test.csproj @@ -0,0 +1,14 @@ + + + + net5.0 + false + + + + + + + + + diff --git a/ReleaseNotes.csproj.import b/ReleaseNotes.csproj.import new file mode 100644 index 0000000..a6ecde3 --- /dev/null +++ b/ReleaseNotes.csproj.import @@ -0,0 +1,44 @@ + + + * 2.0.16 + - Override the ToString method of SerialEndPoint for friendly logging. +* 2.0.15 + - Added .NET Core support + - Fix the problem that UDP does not work in mono +* 2.0.12 + - Fixed memory leak in SocketAcceptor + - Fixed unhandled exceptions in sending/receiving in SocketSession + - Fixed missing WriteTimeout in IoSessionConfig (thanks @UCan927) +* 2.0.11 + - Added client mode in SslFilter (thanks @ddfczm) + - Fixed invalid reading in SslFilter + - Fixed incorrect use of Semaphore in ProtocolCodecFilter +* 2.0.10 + - Fixed potential performance degradation (thanks @gmav) + - Fixed IConnectFuture.Cancel() +* 2.0.9 - Apache MINA 2.0.9 + - Added InputClosed event + - Added support for UDP multicast + - Added throughput calculation + - Updated Common.Logging to v3.0.0 + - Fixed a lot +* 2.0.7.1 + - Added test for KeepAliveFilter + - Fixed incorrect IoEventType + - Fixed incorrect method calls in socket transport +* 2.0.7 - First release based on Apache MINA 2.0.7 + - Unified yet simple API for various transport types: + - TCP/IP & UDP/IP via .NET asynchronous socket + - serial communication + - loopback (in-application pipe) + - Extensible filters + - Low-level and high-level API: + - low-level: uses IoBuffers + - high-level: uses user-defined message objects and codecs + - Highly customizable thread model + - Out-of-the-box SSL · TLS + - Overload shielding & traffic throttling + - Stream-based I/O support via StreamIoHandler + - Tested + + \ No newline at end of file