From 0835b63a7d9f8389d35c0732ada9a6293f211479 Mon Sep 17 00:00:00 2001 From: Ronan Farrell Date: Tue, 18 Jun 2019 15:16:45 +0100 Subject: [PATCH 1/3] Port to .NET standard --- SimpleTCP/Properties/AssemblyInfo.cs | 36 --------------- SimpleTCP/SimpleTCP.csproj | 66 ++++------------------------ SimpleTCP/SimpleTCP.nuspec | 2 +- 3 files changed, 9 insertions(+), 95 deletions(-) delete mode 100644 SimpleTCP/Properties/AssemblyInfo.cs diff --git a/SimpleTCP/Properties/AssemblyInfo.cs b/SimpleTCP/Properties/AssemblyInfo.cs deleted file mode 100644 index 174513e..0000000 --- a/SimpleTCP/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("SimpleTCP")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("SimpleTCP")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("c9c99f87-e188-49d2-a323-09fe79f39f8d")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/SimpleTCP/SimpleTCP.csproj b/SimpleTCP/SimpleTCP.csproj index bc5ae86..2922567 100644 --- a/SimpleTCP/SimpleTCP.csproj +++ b/SimpleTCP/SimpleTCP.csproj @@ -1,63 +1,13 @@ - - - + + - Debug - AnyCPU - {C9C99F87-E188-49D2-A323-09FE79F39F8D} - Library - Properties - SimpleTCP - SimpleTCP - v4.5 - 512 - + netstandard2.0 + false + 1.1.0 - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - + - + - - + \ No newline at end of file diff --git a/SimpleTCP/SimpleTCP.nuspec b/SimpleTCP/SimpleTCP.nuspec index f8ad6f2..91c45dc 100644 --- a/SimpleTCP/SimpleTCP.nuspec +++ b/SimpleTCP/SimpleTCP.nuspec @@ -10,7 +10,7 @@ false Simple and straightforward library for TCP client and servers. Extremely useful for reading/writing with line-by-line command interfaces. Supports binary and string messages, automatic string trimming, and end-of-message delimiter (newline by default). - Copyright 2015 + Copyright 2019 SimpleTCP socket client server tcp \ No newline at end of file From 877879629a1a600b0bcc6bae913c88c28136ec05 Mon Sep 17 00:00:00 2001 From: Ronan Farrell Date: Tue, 18 Jun 2019 15:19:27 +0100 Subject: [PATCH 2/3] remove and sort usings --- SimpleTCP/Message.cs | 6 +----- SimpleTCP/Server/ConnectedClient.cs | 7 +------ SimpleTCP/Server/ServerListener.cs | 6 +----- SimpleTCP/Server/TcpListenerEx.cs | 17 ++++++----------- SimpleTCP/SimpleTcpClient.cs | 4 +--- SimpleTCP/SimpleTcpServer.cs | 3 --- 6 files changed, 10 insertions(+), 33 deletions(-) diff --git a/SimpleTCP/Message.cs b/SimpleTCP/Message.cs index d9d9a6a..8ba44e8 100644 --- a/SimpleTCP/Message.cs +++ b/SimpleTCP/Message.cs @@ -1,9 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; +using System.Linq; using System.Net.Sockets; -using System.Text; -using System.Threading.Tasks; namespace SimpleTCP { diff --git a/SimpleTCP/Server/ConnectedClient.cs b/SimpleTCP/Server/ConnectedClient.cs index c1704a2..65179f4 100644 --- a/SimpleTCP/Server/ConnectedClient.cs +++ b/SimpleTCP/Server/ConnectedClient.cs @@ -1,10 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; +using System.Net; using System.Net.Sockets; -using System.Text; -using System.Threading.Tasks; namespace SimpleTCP { diff --git a/SimpleTCP/Server/ServerListener.cs b/SimpleTCP/Server/ServerListener.cs index 7f39d97..5fc2064 100644 --- a/SimpleTCP/Server/ServerListener.cs +++ b/SimpleTCP/Server/ServerListener.cs @@ -1,11 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; +using System.Collections.Generic; using System.Net; using System.Net.Sockets; -using System.Text; using System.Threading; -using System.Threading.Tasks; namespace SimpleTCP.Server { diff --git a/SimpleTCP/Server/TcpListenerEx.cs b/SimpleTCP/Server/TcpListenerEx.cs index 1811c48..b23958c 100644 --- a/SimpleTCP/Server/TcpListenerEx.cs +++ b/SimpleTCP/Server/TcpListenerEx.cs @@ -1,18 +1,13 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; +using System.Net; using System.Net.Sockets; -using System.Text; -using System.Threading.Tasks; namespace SimpleTCP.Server { - /// - /// Wrapper around TcpListener that exposes the Active property - /// See: http://stackoverflow.com/questions/7630094/is-there-a-property-method-for-determining-if-a-tcplistener-is-currently-listeni - /// - public class TcpListenerEx : TcpListener + /// + /// Wrapper around TcpListener that exposes the Active property + /// See: http://stackoverflow.com/questions/7630094/is-there-a-property-method-for-determining-if-a-tcplistener-is-currently-listeni + /// + public class TcpListenerEx : TcpListener { /// /// Initializes a new instance of the class with the specified local endpoint. diff --git a/SimpleTCP/SimpleTcpClient.cs b/SimpleTCP/SimpleTcpClient.cs index 5c66a93..ea178eb 100644 --- a/SimpleTCP/SimpleTcpClient.cs +++ b/SimpleTCP/SimpleTcpClient.cs @@ -3,13 +3,11 @@ using System.Diagnostics; using System.Linq; using System.Net.Sockets; -using System.Text; using System.Threading; -using System.Threading.Tasks; namespace SimpleTCP { - public class SimpleTcpClient : IDisposable + public class SimpleTcpClient : IDisposable { public SimpleTcpClient() { diff --git a/SimpleTCP/SimpleTcpServer.cs b/SimpleTCP/SimpleTcpServer.cs index bdafc3e..8f0a2d0 100644 --- a/SimpleTCP/SimpleTcpServer.cs +++ b/SimpleTCP/SimpleTcpServer.cs @@ -1,13 +1,10 @@ using System; -using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.NetworkInformation; using System.Net.Sockets; -using System.Text; using System.Threading; -using System.Threading.Tasks; namespace SimpleTCP { From 6377f8e8012cc51c209f8e644fc1c2847fc516c7 Mon Sep 17 00:00:00 2001 From: Ronan Farrell Date: Tue, 18 Jun 2019 15:21:22 +0100 Subject: [PATCH 3/3] Update tests project to .net 4.8 --- SimpleTCP.Tests/SimpleTCP.Tests.csproj | 3 ++- SimpleTCP/SimpleTCP.csproj | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/SimpleTCP.Tests/SimpleTCP.Tests.csproj b/SimpleTCP.Tests/SimpleTCP.Tests.csproj index d88a9e4..df93553 100644 --- a/SimpleTCP.Tests/SimpleTCP.Tests.csproj +++ b/SimpleTCP.Tests/SimpleTCP.Tests.csproj @@ -8,7 +8,7 @@ Properties SimpleTCP.Tests SimpleTCP.Tests - v4.5.2 + v4.8 512 {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 10.0 @@ -16,6 +16,7 @@ $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages False UnitTest + true diff --git a/SimpleTCP/SimpleTCP.csproj b/SimpleTCP/SimpleTCP.csproj index 2922567..904f6a1 100644 --- a/SimpleTCP/SimpleTCP.csproj +++ b/SimpleTCP/SimpleTCP.csproj @@ -2,7 +2,7 @@ netstandard2.0 - false + true 1.1.0