├── Extasys for Java ├── nbproject │ ├── private │ │ ├── config.properties │ │ ├── private.properties │ │ └── private.xml │ ├── genfiles.properties │ ├── project.xml │ └── project.properties ├── src │ └── Extasys │ │ ├── Settings │ │ └── Settings.java │ │ ├── DataConvertion │ │ ├── DataConverter.java │ │ ├── NullDataConverter.java │ │ └── Base64Converter.java │ │ ├── DataFrame.java │ │ ├── Network │ │ ├── TCP │ │ │ ├── Client │ │ │ │ ├── Exceptions │ │ │ │ │ ├── ConnectorDisconnectedException.java │ │ │ │ │ └── ConnectorCannotSendPacketException.java │ │ │ │ └── Connectors │ │ │ │ │ ├── TCPConnectorMessageCollector.java │ │ │ │ │ └── Packets │ │ │ │ │ └── IncomingTCPClientPacket.java │ │ │ └── Server │ │ │ │ └── Listener │ │ │ │ ├── Exceptions │ │ │ │ ├── ClientIsDisconnectedException.java │ │ │ │ └── OutgoingPacketFailedException.java │ │ │ │ ├── TCPClientConnectionMessageCollector.java │ │ │ │ ├── TCPListenerThread.java │ │ │ │ └── Packets │ │ │ │ └── IncomingTCPClientConnectionPacket.java │ │ ├── UDP │ │ │ ├── Server │ │ │ │ └── Listener │ │ │ │ │ └── Packets │ │ │ │ │ ├── OutgoingUDPServerPacket.java │ │ │ │ │ └── IncomingUDPServerPacket.java │ │ │ └── Client │ │ │ │ └── Connectors │ │ │ │ └── Packets │ │ │ │ └── OutgoingUDPClientPacket.java │ │ ├── NetworkPacket.java │ │ └── Abstract │ │ │ ├── AbstractServer.java │ │ │ └── AbstractClient.java │ │ ├── MessageCollector │ │ ├── MessageETX.java │ │ └── MessageCollector.java │ │ ├── ManualResetEvent.java │ │ └── ExtasysThreadPool.java └── build.xml ├── Extasys for Java Examples ├── Extasys.Examples.TCPClient │ ├── nbproject │ │ ├── private │ │ │ ├── config.properties │ │ │ ├── private.properties │ │ │ └── private.xml │ │ ├── genfiles.properties │ │ ├── project.xml │ │ └── project.properties │ ├── manifest.mf │ └── build.xml ├── Extasys.Examples.TCPServer │ ├── nbproject │ │ ├── private │ │ │ ├── config.properties │ │ │ ├── private.properties │ │ │ ├── profiler │ │ │ │ └── settings.xml │ │ │ └── private.xml │ │ ├── genfiles.properties │ │ ├── project.xml │ │ └── project.properties │ ├── manifest.mf │ ├── src │ │ └── Extasys │ │ │ └── Examples │ │ │ └── TCPServer │ │ │ └── TCPServer.java │ └── build.xml ├── Extasys.Examples.UDPClient │ ├── nbproject │ │ ├── private │ │ │ ├── config.properties │ │ │ ├── private.properties │ │ │ └── private.xml │ │ ├── genfiles.properties │ │ ├── project.xml │ │ └── project.properties │ ├── manifest.mf │ └── build.xml ├── Extasys.Examples.UDPServer │ ├── nbproject │ │ ├── private │ │ │ ├── config.properties │ │ │ ├── private.properties │ │ │ └── private.xml │ │ ├── genfiles.properties │ │ ├── project.xml │ │ └── project.properties │ ├── manifest.mf │ ├── src │ │ └── Extasys │ │ │ └── Examples │ │ │ └── UDPServer │ │ │ └── UDPServer.java │ └── build.xml ├── Extasys.Examples.TCPChatClient │ ├── nbproject │ │ ├── private │ │ │ ├── config.properties │ │ │ ├── private.properties │ │ │ └── private.xml │ │ ├── genfiles.properties │ │ └── project.xml │ ├── manifest.mf │ └── src │ │ └── Extasys │ │ └── Examples │ │ └── TCPChatClient │ │ └── MessageToken.java ├── Extasys.Examples.TCPChatServer │ ├── nbproject │ │ ├── private │ │ │ ├── config.properties │ │ │ ├── private.properties │ │ │ └── private.xml │ │ ├── genfiles.properties │ │ └── project.xml │ ├── manifest.mf │ └── src │ │ └── Extasys │ │ └── Examples │ │ └── TCPChatServer │ │ ├── TCPChatUser.java │ │ └── MessageToken.java └── External Libraries │ └── gson-2.10.1.jar ├── Images ├── ChatServer Screenshot.png ├── Wiki Images │ ├── HowToImportExtasys_1.jpg │ ├── HowToImportExtasys_2.jpg │ ├── HowToImportExtasys_3.jpg │ └── HowToImportExtasys_4.jpg └── Test Screenshots │ ├── Extasys Performance Intel i7-2600 3.4GHz.png │ └── Extasys Performance Intel i7-2600 3.4GHz Local Machine.png ├── .github └── ISSUE_TEMPLATE │ ├── custom.md │ ├── feature_request.md │ └── bug_report.md ├── Deprecated └── Extasys for .NET │ ├── Extasys.Examples.TCPClient │ ├── app.config │ ├── Properties │ │ ├── Settings.settings │ │ ├── Settings.Designer.cs │ │ ├── AssemblyInfo.cs │ │ └── Resources.Designer.cs │ ├── Program.cs │ ├── Form1.cs │ └── TCPClient.cs │ ├── Extasys.Examples.TCPServer │ ├── app.config │ ├── Properties │ │ ├── Settings.settings │ │ ├── Settings.Designer.cs │ │ ├── AssemblyInfo.cs │ │ └── Resources.Designer.cs │ ├── Program.cs │ ├── Form1.cs │ └── TCPServer.cs │ ├── Extasys.Examples.UDPClient │ ├── app.config │ ├── Properties │ │ ├── Settings.settings │ │ ├── Settings.Designer.cs │ │ ├── AssemblyInfo.cs │ │ └── Resources.Designer.cs │ ├── Program.cs │ ├── UDPClient.cs │ └── Form1.cs │ ├── Extasys │ ├── Extasys │ │ ├── Class1.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── Extasys.csproj │ ├── Extasys.sln │ ├── Properties │ │ └── AssemblyInfo.cs │ └── Network │ │ ├── TCP │ │ ├── Server │ │ │ └── Listener │ │ │ │ ├── Exceptions │ │ │ │ ├── ClientIsDisconnectedException.cs │ │ │ │ └── OutgoingPacketFailedException.cs │ │ │ │ ├── Tools │ │ │ │ └── TCPClientConnectionMessageCollector.cs │ │ │ │ └── TCPListenerThread.cs │ │ └── Client │ │ │ ├── Exceptions │ │ │ ├── ConnectorDisconnectedException.cs │ │ │ └── ConnectorCannotSendPacketException.cs │ │ │ └── Connectors │ │ │ ├── Tools │ │ │ └── TCPClientMessageCollector.cs │ │ │ └── Packets │ │ │ └── MessageCollectorTCPClientPacket.cs │ │ ├── DataFrame.cs │ │ ├── DatagramPacket.cs │ │ └── UDP │ │ └── Client │ │ └── Connectors │ │ └── Packets │ │ └── IncomingUDPClientPacket.cs │ └── Extasys.sln ├── LICENSE └── README.md /Extasys for Java/nbproject/private/config.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.TCPClient/nbproject/private/config.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.TCPServer/nbproject/private/config.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.UDPClient/nbproject/private/config.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.UDPServer/nbproject/private/config.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.TCPChatClient/nbproject/private/config.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.TCPChatServer/nbproject/private/config.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Images/ChatServer Screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nsiatras/extasys/HEAD/Images/ChatServer Screenshot.png -------------------------------------------------------------------------------- /Images/Wiki Images/HowToImportExtasys_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nsiatras/extasys/HEAD/Images/Wiki Images/HowToImportExtasys_1.jpg -------------------------------------------------------------------------------- /Images/Wiki Images/HowToImportExtasys_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nsiatras/extasys/HEAD/Images/Wiki Images/HowToImportExtasys_2.jpg -------------------------------------------------------------------------------- /Images/Wiki Images/HowToImportExtasys_3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nsiatras/extasys/HEAD/Images/Wiki Images/HowToImportExtasys_3.jpg -------------------------------------------------------------------------------- /Images/Wiki Images/HowToImportExtasys_4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nsiatras/extasys/HEAD/Images/Wiki Images/HowToImportExtasys_4.jpg -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.TCPClient/manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.TCPServer/manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.UDPClient/manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.UDPServer/manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.TCPChatClient/manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.TCPChatServer/manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /Extasys for Java Examples/External Libraries/gson-2.10.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nsiatras/extasys/HEAD/Extasys for Java Examples/External Libraries/gson-2.10.1.jar -------------------------------------------------------------------------------- /Images/Test Screenshots/Extasys Performance Intel i7-2600 3.4GHz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nsiatras/extasys/HEAD/Images/Test Screenshots/Extasys Performance Intel i7-2600 3.4GHz.png -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/custom.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Custom issue template 3 | about: Describe this issue template's purpose here. 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys.Examples.TCPClient/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys.Examples.TCPServer/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys.Examples.UDPClient/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Images/Test Screenshots/Extasys Performance Intel i7-2600 3.4GHz Local Machine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nsiatras/extasys/HEAD/Images/Test Screenshots/Extasys Performance Intel i7-2600 3.4GHz Local Machine.png -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys/Extasys/Class1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Extasys 7 | { 8 | public class Class1 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Extasys for Java/nbproject/private/private.properties: -------------------------------------------------------------------------------- 1 | compile.on.save=true 2 | do.depend=false 3 | do.jar=true 4 | do.jlink=false 5 | javac.debug=true 6 | javadoc.preview=true 7 | jlink.strip=false 8 | user.properties.file=C:\\Users\\nsiat\\AppData\\Roaming\\NetBeans\\26\\build.properties 9 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.TCPChatClient/nbproject/private/private.properties: -------------------------------------------------------------------------------- 1 | compile.on.save=true 2 | do.depend=false 3 | do.jar=true 4 | do.jlink=false 5 | javac.debug=true 6 | javadoc.preview=true 7 | jlink.strip=false 8 | user.properties.file=C:\\Users\\nsiat\\AppData\\Roaming\\NetBeans\\26\\build.properties 9 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.TCPChatServer/nbproject/private/private.properties: -------------------------------------------------------------------------------- 1 | compile.on.save=true 2 | do.depend=false 3 | do.jar=true 4 | do.jlink=false 5 | javac.debug=true 6 | javadoc.preview=true 7 | jlink.strip=false 8 | user.properties.file=C:\\Users\\nsiat\\AppData\\Roaming\\NetBeans\\26\\build.properties 9 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.TCPClient/nbproject/private/private.properties: -------------------------------------------------------------------------------- 1 | compile.on.save=true 2 | do.depend=false 3 | do.jar=true 4 | do.jlink=false 5 | javac.debug=true 6 | javadoc.preview=true 7 | jlink.strip=false 8 | user.properties.file=C:\\Users\\nsiat\\AppData\\Roaming\\NetBeans\\26\\build.properties 9 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.TCPServer/nbproject/private/private.properties: -------------------------------------------------------------------------------- 1 | compile.on.save=true 2 | do.depend=false 3 | do.jar=true 4 | do.jlink=false 5 | javac.debug=true 6 | javadoc.preview=true 7 | jlink.strip=false 8 | user.properties.file=C:\\Users\\nsiat\\AppData\\Roaming\\NetBeans\\26\\build.properties 9 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.UDPClient/nbproject/private/private.properties: -------------------------------------------------------------------------------- 1 | compile.on.save=true 2 | do.depend=false 3 | do.jar=true 4 | do.jlink=false 5 | javac.debug=true 6 | javadoc.preview=true 7 | jlink.strip=false 8 | user.properties.file=C:\\Users\\nsiat\\AppData\\Roaming\\NetBeans\\26\\build.properties 9 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.UDPServer/nbproject/private/private.properties: -------------------------------------------------------------------------------- 1 | compile.on.save=true 2 | do.depend=false 3 | do.jar=true 4 | do.jlink=false 5 | javac.debug=true 6 | javadoc.preview=true 7 | jlink.strip=false 8 | user.properties.file=C:\\Users\\nsiat\\AppData\\Roaming\\NetBeans\\26\\build.properties 9 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.TCPServer/nbproject/private/profiler/settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #org.netbeans.modules.profiler.v2.features.ObjectsFeature@ 5 | 6 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys.Examples.TCPClient/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys.Examples.TCPServer/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys.Examples.UDPClient/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Extasys for Java/nbproject/private/private.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.TCPClient/nbproject/private/private.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.TCPServer/nbproject/private/private.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.UDPClient/nbproject/private/private.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.UDPServer/nbproject/private/private.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.TCPChatClient/nbproject/private/private.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.TCPChatServer/nbproject/private/private.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Extasys for Java/nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=2f10d0ea 2 | build.xml.script.CRC32=bd077575 3 | build.xml.stylesheet.CRC32=f85dc8f2@1.107.0.48 4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. 5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. 6 | nbproject/build-impl.xml.data.CRC32=2f10d0ea 7 | nbproject/build-impl.xml.script.CRC32=040bdf2f 8 | nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.107.0.48 9 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.TCPClient/nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=6130540c 2 | build.xml.script.CRC32=cb7b9b5c 3 | build.xml.stylesheet.CRC32=f85dc8f2@1.107.0.48 4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. 5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. 6 | nbproject/build-impl.xml.data.CRC32=6130540c 7 | nbproject/build-impl.xml.script.CRC32=e3ba5dcd 8 | nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.107.0.48 9 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.TCPServer/nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=75c20d80 2 | build.xml.script.CRC32=c8a2284d 3 | build.xml.stylesheet.CRC32=f85dc8f2@1.107.0.48 4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. 5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. 6 | nbproject/build-impl.xml.data.CRC32=75c20d80 7 | nbproject/build-impl.xml.script.CRC32=6f390158 8 | nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.107.0.48 9 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.UDPClient/nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=c0ea9fe1 2 | build.xml.script.CRC32=b5c2b7b4 3 | build.xml.stylesheet.CRC32=f85dc8f2@1.107.0.48 4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. 5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. 6 | nbproject/build-impl.xml.data.CRC32=c0ea9fe1 7 | nbproject/build-impl.xml.script.CRC32=9e623be4 8 | nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.107.0.48 9 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.UDPServer/nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=d418c66d 2 | build.xml.script.CRC32=b61b04a5 3 | build.xml.stylesheet.CRC32=f85dc8f2@1.107.0.48 4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. 5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. 6 | nbproject/build-impl.xml.data.CRC32=d418c66d 7 | nbproject/build-impl.xml.script.CRC32=12e16771 8 | nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.107.0.48 9 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.TCPChatClient/nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=02a00a6b 2 | build.xml.script.CRC32=ac29bcd4 3 | build.xml.stylesheet.CRC32=f85dc8f2@1.107.0.48 4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. 5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. 6 | nbproject/build-impl.xml.data.CRC32=02a00a6b 7 | nbproject/build-impl.xml.script.CRC32=d31d85c4 8 | nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.107.0.48 9 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.TCPChatServer/nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=165253e7 2 | build.xml.script.CRC32=a0d553d0 3 | build.xml.stylesheet.CRC32=f85dc8f2@1.107.0.48 4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. 5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. 6 | nbproject/build-impl.xml.data.CRC32=165253e7 7 | nbproject/build-impl.xml.script.CRC32=b1971876 8 | nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.107.0.48 9 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys.Examples.TCPClient/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Windows.Forms; 5 | 6 | namespace Extasys.Examples.TCPClient 7 | { 8 | static class Program 9 | { 10 | /// 11 | /// The main entry point for the application. 12 | /// 13 | [STAThread] 14 | static void Main() 15 | { 16 | Application.EnableVisualStyles(); 17 | Application.SetCompatibleTextRenderingDefault(false); 18 | Application.Run(new Form1()); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys.Examples.TCPServer/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Windows.Forms; 5 | 6 | namespace Extasys.Examples.TCPServer 7 | { 8 | static class Program 9 | { 10 | /// 11 | /// The main entry point for the application. 12 | /// 13 | [STAThread] 14 | static void Main() 15 | { 16 | Application.EnableVisualStyles(); 17 | Application.SetCompatibleTextRenderingDefault(false); 18 | Application.Run(new Form1()); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys.Examples.UDPClient/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Windows.Forms; 5 | 6 | namespace Extasys.Examples.UDPClient 7 | { 8 | static class Program 9 | { 10 | /// 11 | /// The main entry point for the application. 12 | /// 13 | [STAThread] 14 | static void Main() 15 | { 16 | Application.EnableVisualStyles(); 17 | Application.SetCompatibleTextRenderingDefault(false); 18 | Application.Run(new Form1()); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys.Examples.UDPClient/UDPClient.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace Extasys.Examples.UDPClient 7 | { 8 | public class UDPClient : Extasys.Network.UDP.Client.ExtasysUDPClient 9 | { 10 | public UDPClient(string name, string description) 11 | : base(name, description) 12 | { 13 | 14 | } 15 | 16 | public override void OnDataReceive(Extasys.Network.UDP.Client.Connectors.UDPConnector connector, Extasys.Network.DatagramPacket packet) 17 | { 18 | Console.WriteLine(packet.ServerEndPoint.Address.ToString() + " : " + Encoding.Default.GetString(packet.Bytes)); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Extasys for Java/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | Extasys 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | datagram 16 | Extasys 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys/Extasys.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 10.00 3 | # Visual Studio 2008 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Extasys", "Extasys\Extasys.csproj", "{2A003801-C61F-4007-BCD7-A1A91B0871D8}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {2A003801-C61F-4007-BCD7-A1A91B0871D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {2A003801-C61F-4007-BCD7-A1A91B0871D8}.Debug|Any CPU.Build.0 = Debug|Any CPU 14 | {2A003801-C61F-4007-BCD7-A1A91B0871D8}.Release|Any CPU.ActiveCfg = Release|Any CPU 15 | {2A003801-C61F-4007-BCD7-A1A91B0871D8}.Release|Any CPU.Build.0 = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.TCPClient/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | Extasys.Examples.TCPClient 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | Extasys 17 | jar 18 | 19 | jar 20 | clean 21 | jar 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.TCPServer/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | Extasys.Examples.TCPServer 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | Extasys 17 | jar 18 | 19 | jar 20 | clean 21 | jar 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.UDPClient/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | Extasys.Examples.UDPClient 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | Extasys 17 | jar 18 | 19 | jar 20 | clean 21 | jar 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.UDPServer/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | Extasys.Examples.UDPServer 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | Extasys 17 | jar 18 | 19 | jar 20 | clean 21 | jar 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.TCPChatClient/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | Extasys.Examples.TCPChatClient 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | Extasys 17 | jar 18 | 19 | jar 20 | clean 21 | jar 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.TCPChatServer/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | Extasys.Examples.TCPChatServer 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | Extasys 17 | jar 18 | 19 | jar 20 | clean 21 | jar 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2008 Nikos Siatras 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys.Examples.TCPClient/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.1 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Extasys.Examples.TCPClient.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys.Examples.TCPServer/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.1 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Extasys.Examples.TCPServer.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys.Examples.UDPClient/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.1 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Extasys.Examples.UDPClient.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Extasys for Java/src/Extasys/Settings/Settings.java: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2024 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | package Extasys.Settings; 21 | 22 | /** 23 | * 24 | * @author Nikos Siatras 25 | */ 26 | public class Settings 27 | { 28 | 29 | public static final String VERSION = "Extasys NT v1.0.7"; 30 | } 31 | -------------------------------------------------------------------------------- /Extasys for Java/src/Extasys/DataConvertion/DataConverter.java: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2024 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | package Extasys.DataConvertion; 21 | 22 | /** 23 | * 24 | * @author Nikos Siatras 25 | */ 26 | public abstract class DataConverter 27 | { 28 | 29 | public abstract byte[] Convert(final byte[] bytes); 30 | 31 | public abstract byte[] Revert(final byte[] bytes); 32 | } 33 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Extasys")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Extasys")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2009")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("d2348d6a-d3aa-4da4-addd-12bacdeaa196")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys/Extasys/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Extasys")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Extasys")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2009")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("d2348d6a-d3aa-4da4-addd-12bacdeaa196")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Extasys for Java/src/Extasys/DataConvertion/NullDataConverter.java: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2024 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | package Extasys.DataConvertion; 21 | 22 | /** 23 | * 24 | * @author Nikos Siatras 25 | */ 26 | public class NullDataConverter extends DataConverter 27 | { 28 | 29 | @Override 30 | public byte[] Convert(final byte[] bytes) 31 | { 32 | return bytes; 33 | } 34 | 35 | @Override 36 | public byte[] Revert(final byte[] bytes) 37 | { 38 | return bytes; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys.Examples.TCPClient/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Extasys.Examples.TCPClient")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Extasys.Examples.TCPClient")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2009")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("2117b916-44b0-498a-8f93-eef987854c78")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys.Examples.TCPServer/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Extasys.Examples.TCPServer")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Extasys.Examples.TCPServer")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2009")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("62d67d41-c100-4958-b348-0967a4faea6f")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys.Examples.UDPClient/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Extasys.Examples.UDPClient")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("Extasys.Examples.UDPClient")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2009")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("f7719fa5-6e10-4e27-9e87-6403d75ec25f")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys.Examples.TCPServer/Form1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | using System.Net; 10 | 11 | namespace Extasys.Examples.TCPServer 12 | { 13 | public partial class Form1 : Form 14 | { 15 | private TCPServer fServer = new TCPServer("Server", ""); 16 | 17 | public Form1() 18 | { 19 | InitializeComponent(); 20 | } 21 | 22 | private void button1_Click(object sender, EventArgs e) 23 | { 24 | fServer.Listeners.Clear(); 25 | fServer.AddListener("A", IPAddress.Parse(textBoxIP.Text), int.Parse(textBoxPort.Text), int.Parse(textBoxMaxConnections.Text), 65535, int.Parse(textBoxCOnnectionTimeOut.Text), 100,((char)2)); 26 | fServer.Start(); 27 | 28 | button1.Enabled = false; 29 | button2.Enabled = true; 30 | } 31 | 32 | private void button2_Click(object sender, EventArgs e) 33 | { 34 | fServer.Stop(); 35 | 36 | button1.Enabled = true; 37 | button2.Enabled = false; 38 | } 39 | 40 | private void timer1_Tick(object sender, EventArgs e) 41 | { 42 | labelBytesIn.Text = fServer.BytesIn.ToString(); 43 | labelBytesOut.Text = fServer.BytesOut.ToString(); 44 | labelClientsConnected.Text = fServer.CurrentConnectionsNumber.ToString(); 45 | } 46 | 47 | private void Form1_FormClosing(object sender, FormClosingEventArgs e) 48 | { 49 | fServer.Stop(); 50 | } 51 | 52 | private void Form1_Load(object sender, EventArgs e) 53 | { 54 | 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Extasys for Java/src/Extasys/DataFrame.java: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2008 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | package Extasys; 21 | 22 | import java.util.Arrays; 23 | 24 | /** 25 | * 26 | * @author Nikos Siatras 27 | */ 28 | public final class DataFrame 29 | { 30 | 31 | private final byte[] fBytes; 32 | private final int fLength; 33 | 34 | public DataFrame(byte[] bytes) 35 | { 36 | fBytes = bytes; 37 | fLength = bytes.length; 38 | } 39 | 40 | public DataFrame(byte[] bytes, int offset, int length) 41 | { 42 | fBytes = Arrays.copyOfRange(bytes, offset, length); 43 | fLength = fBytes.length; 44 | } 45 | 46 | public final byte[] getBytes() 47 | { 48 | return fBytes; 49 | } 50 | 51 | public final int getLength() 52 | { 53 | return fLength; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.TCPChatServer/src/Extasys/Examples/TCPChatServer/TCPChatUser.java: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2008 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | package Extasys.Examples.TCPChatServer; 21 | 22 | import Extasys.Network.TCP.Server.Listener.TCPClientConnection; 23 | 24 | /** 25 | * 26 | * @author Nikos Siatras 27 | */ 28 | public class TCPChatUser 29 | { 30 | 31 | private final String fUsername; 32 | private final TCPClientConnection fConnection; 33 | 34 | public TCPChatUser(String username, TCPClientConnection connection) 35 | { 36 | fUsername = username; 37 | fConnection = connection; 38 | } 39 | 40 | public String getUsername() 41 | { 42 | return fUsername; 43 | } 44 | 45 | public TCPClientConnection getConnection() 46 | { 47 | return fConnection; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys.Examples.TCPServer/TCPServer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Extasys.Network.TCP.Server.Listener.Exceptions; 6 | 7 | namespace Extasys.Examples.TCPServer 8 | { 9 | public class TCPServer : Extasys.Network.TCP.Server.ExtasysTCPServer 10 | { 11 | public TCPServer(string name,string description) 12 | :base(name,description) 13 | { 14 | } 15 | 16 | public override void OnClientConnect(Extasys.Network.TCP.Server.Listener.TCPClientConnection client) 17 | { 18 | client.Name = client.IPAddress.ToString(); // Set a name for this client if you want to. 19 | Console.WriteLine(client.IPAddress.ToString() + " connected."); 20 | Console.WriteLine("Total clients connected: " + this.CurrentConnectionsNumber); 21 | } 22 | 23 | public override void OnClientDisconnect(Extasys.Network.TCP.Server.Listener.TCPClientConnection client) 24 | { 25 | 26 | } 27 | 28 | public override void OnDataReceive(Extasys.Network.TCP.Server.Listener.TCPClientConnection sender, Extasys.Network.DataFrame data) 29 | { 30 | // Client sends data to server. 31 | // Reply the received data back to sender. 32 | byte [] bytes = new byte[data.Length+1]; 33 | Buffer.BlockCopy(data.Bytes,0,bytes,0,data.Length); 34 | bytes[data.Length] = (byte)((char)2); 35 | try 36 | { 37 | sender.SendData(bytes, 0, bytes.Length); 38 | } 39 | catch (ClientIsDisconnectedException ex) 40 | { 41 | } 42 | catch (OutgoingPacketFailedException ex) 43 | { 44 | } 45 | catch (Exception ex) 46 | { 47 | 48 | } 49 | } 50 | 51 | 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys/Network/TCP/Server/Listener/Exceptions/ClientIsDisconnectedException.cs: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2008 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | using System; 21 | using System.Collections.Generic; 22 | using System.Linq; 23 | using System.Text; 24 | 25 | namespace Extasys.Network.TCP.Server.Listener.Exceptions 26 | { 27 | public class ClientIsDisconnectedException : Exception 28 | { 29 | private TCPClientConnection fClient; 30 | 31 | public ClientIsDisconnectedException(TCPClientConnection client) 32 | :base("Client is disconnected.") 33 | { 34 | fClient = client; 35 | } 36 | 37 | /// 38 | /// Returns the disconnected client. 39 | /// 40 | public TCPClientConnection Client 41 | { 42 | get { return fClient; } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Extasys for Java/src/Extasys/Network/TCP/Client/Exceptions/ConnectorDisconnectedException.java: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2008 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | package Extasys.Network.TCP.Client.Exceptions; 21 | 22 | import Extasys.Network.TCP.Client.Connectors.TCPConnector; 23 | 24 | /** 25 | * 26 | * @author Nikos Siatras 27 | */ 28 | public class ConnectorDisconnectedException extends Exception 29 | { 30 | 31 | private final TCPConnector fConnector; 32 | 33 | public ConnectorDisconnectedException(TCPConnector connector) 34 | { 35 | super("Connector is disconnected"); 36 | fConnector = connector; 37 | } 38 | 39 | /** 40 | * Returns the disconnected connector. 41 | * 42 | * @return the disconnected connector. 43 | */ 44 | public TCPConnector getConnectorInstance() 45 | { 46 | return fConnector; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Extasys for Java/src/Extasys/Network/TCP/Server/Listener/Exceptions/ClientIsDisconnectedException.java: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2008 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | package Extasys.Network.TCP.Server.Listener.Exceptions; 21 | 22 | import Extasys.Network.TCP.Server.Listener.TCPClientConnection; 23 | 24 | /** 25 | * 26 | * @author Nikos Siatras 27 | */ 28 | public class ClientIsDisconnectedException extends Exception 29 | { 30 | 31 | private final TCPClientConnection fClient; 32 | 33 | public ClientIsDisconnectedException(TCPClientConnection client) 34 | { 35 | super("Client is disconnected."); 36 | fClient = client; 37 | } 38 | 39 | /** 40 | * Returns the disconnected client. 41 | * 42 | * @return the disconnected client. 43 | */ 44 | public final TCPClientConnection getClient() 45 | { 46 | return fClient; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Extasys for Java/src/Extasys/Network/TCP/Client/Connectors/TCPConnectorMessageCollector.java: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2008 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | package Extasys.Network.TCP.Client.Connectors; 21 | 22 | import Extasys.DataFrame; 23 | import Extasys.MessageCollector.MessageCollector; 24 | import Extasys.MessageCollector.MessageETX; 25 | 26 | /** 27 | * 28 | * @author Nikos Siatras 29 | */ 30 | public class TCPConnectorMessageCollector extends MessageCollector 31 | { 32 | 33 | private final TCPConnector fMyConnector; 34 | 35 | public TCPConnectorMessageCollector(TCPConnector connector, MessageETX messageETX) 36 | { 37 | super(messageETX); 38 | fMyConnector = connector; 39 | } 40 | 41 | @Override 42 | public void MessageCollected(byte[] bytes) 43 | { 44 | fMyConnector.fMyTCPClient.OnDataReceive(fMyConnector, new DataFrame(bytes)); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys/Network/TCP/Client/Exceptions/ConnectorDisconnectedException.cs: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2008 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | using System; 21 | using System.Collections.Generic; 22 | using System.Linq; 23 | using System.Text; 24 | using Extasys.Network.TCP.Client.Connectors; 25 | 26 | namespace Extasys.Network.TCP.Client.Exceptions 27 | { 28 | public class ConnectorDisconnectedException : Exception 29 | { 30 | private TCPConnector fConnector; 31 | 32 | public ConnectorDisconnectedException(TCPConnector connector) 33 | : base("Connector is disconnected") 34 | { 35 | fConnector = connector; 36 | } 37 | 38 | /// 39 | /// Returns the disconnected connector. 40 | /// 41 | public TCPConnector ConnectorInstance 42 | { 43 | get { return fConnector; } 44 | } 45 | 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Extasys for Java/src/Extasys/Network/TCP/Server/Listener/TCPClientConnectionMessageCollector.java: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2008 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | package Extasys.Network.TCP.Server.Listener; 21 | 22 | import Extasys.DataFrame; 23 | import Extasys.MessageCollector.MessageCollector; 24 | import Extasys.MessageCollector.MessageETX; 25 | 26 | /** 27 | * 28 | * @author Nikos Siatras 29 | */ 30 | public class TCPClientConnectionMessageCollector extends MessageCollector 31 | { 32 | 33 | private final TCPClientConnection fMyClient; 34 | 35 | public TCPClientConnectionMessageCollector(TCPClientConnection myClient, MessageETX messageETX) 36 | { 37 | super(messageETX); 38 | fMyClient = myClient; 39 | } 40 | 41 | @Override 42 | public void MessageCollected(byte[] bytes) 43 | { 44 | fMyClient.fMyExtasysServer.OnDataReceive(fMyClient, new DataFrame(bytes)); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /Extasys for Java/src/Extasys/Network/TCP/Server/Listener/Exceptions/OutgoingPacketFailedException.java: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2008 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | package Extasys.Network.TCP.Server.Listener.Exceptions; 21 | 22 | import Extasys.Network.TCP.Server.Listener.Packets.OutgoingTCPClientConnectionPacket; 23 | 24 | /** 25 | * 26 | * @author Nikos Siatras 27 | */ 28 | public class OutgoingPacketFailedException extends Exception 29 | { 30 | 31 | private final OutgoingTCPClientConnectionPacket fPacket; 32 | 33 | public OutgoingPacketFailedException(OutgoingTCPClientConnectionPacket packet) 34 | { 35 | super("Outgoing packet failed."); 36 | fPacket = packet; 37 | } 38 | 39 | /** 40 | * Returns the failed packet. 41 | * 42 | * @return the failed packet. 43 | */ 44 | public OutgoingTCPClientConnectionPacket getPacket() 45 | { 46 | return fPacket; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys/Network/TCP/Server/Listener/Exceptions/OutgoingPacketFailedException.cs: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2008 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | using System; 21 | using System.Collections.Generic; 22 | using System.Linq; 23 | using System.Text; 24 | using Extasys.Network.TCP.Server.Listener.Packets; 25 | 26 | namespace Extasys.Network.TCP.Server.Listener.Exceptions 27 | { 28 | public class OutgoingPacketFailedException :Exception 29 | { 30 | private OutgoingTCPClientConnectionPacket fPacket; 31 | public OutgoingPacketFailedException(OutgoingTCPClientConnectionPacket packet) 32 | :base("Outgoing packet failed") 33 | { 34 | fPacket = packet; 35 | } 36 | 37 | /// 38 | /// Returns the failed packet. 39 | /// 40 | public OutgoingTCPClientConnectionPacket Packet 41 | { 42 | get { return fPacket; } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Extasys for Java/src/Extasys/MessageCollector/MessageETX.java: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2024 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | package Extasys.MessageCollector; 21 | 22 | /** 23 | * 24 | * @author Nikos Siatras - https://github.com/nsiatras 25 | * 26 | * This class holds the properties of the message splitter for TCP Connections. 27 | * Early Extasys versions holds the ETX as a string. This class was implemented 28 | * to keep message splitter char(characters) as a byte array. 29 | */ 30 | public class MessageETX 31 | { 32 | 33 | private final byte[] fBytes; 34 | 35 | public MessageETX(String messageETX) 36 | { 37 | fBytes = messageETX.getBytes(); 38 | } 39 | 40 | public MessageETX(byte[] bytes) 41 | { 42 | fBytes = bytes; 43 | } 44 | 45 | public byte[] getBytes() 46 | { 47 | return fBytes; 48 | } 49 | 50 | public int getLength() 51 | { 52 | return fBytes.length; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys/Network/DataFrame.cs: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2008 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | using System; 21 | using System.Collections.Generic; 22 | using System.Linq; 23 | using System.Text; 24 | 25 | namespace Extasys.Network 26 | { 27 | public class DataFrame 28 | { 29 | private byte[] fBytes; 30 | private int fLength; 31 | 32 | public DataFrame(byte[] bytes) 33 | { 34 | fBytes = bytes; 35 | fLength = bytes.Length; 36 | } 37 | 38 | public DataFrame(byte[] bytes, int offset, int length) 39 | { 40 | fBytes = new byte[length]; 41 | Buffer.BlockCopy(bytes, offset, fBytes, 0, length); 42 | fLength = length; 43 | } 44 | 45 | public byte[] Bytes 46 | { 47 | get { return fBytes; } 48 | } 49 | 50 | public int Length 51 | { 52 | get { return fLength; } 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys.Examples.TCPClient/Form1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | using System.Net; 10 | 11 | namespace Extasys.Examples.TCPClient 12 | { 13 | public partial class Form1 : Form 14 | { 15 | private TCPClient fClient = new TCPClient("", ""); 16 | public Form1() 17 | { 18 | InitializeComponent(); 19 | } 20 | 21 | private void button1_Click(object sender, EventArgs e) 22 | { 23 | fClient.Connectors.Clear(); 24 | fClient.AddConnector("a", IPAddress.Parse(textBoxRemoteHostIP.Text), int.Parse(textBoxRemoteHostPort.Text), 65535,((char)2)); 25 | fClient.Start(); 26 | 27 | button2.Enabled = true; 28 | button1.Enabled = false; 29 | 30 | button3.Enabled = true; 31 | button4.Enabled = false; 32 | } 33 | 34 | private void button2_Click(object sender, EventArgs e) 35 | { 36 | fClient.Stop(); 37 | 38 | button1.Enabled = true; 39 | button2.Enabled = false; 40 | 41 | button3.Enabled = false; 42 | button4.Enabled = false; 43 | } 44 | 45 | private void button3_Click(object sender, EventArgs e) 46 | { 47 | fClient.StartSendingMessages(); 48 | button3.Enabled = false; 49 | button4.Enabled = true; 50 | } 51 | 52 | private void button4_Click(object sender, EventArgs e) 53 | { 54 | fClient.StopSendingMessages(); 55 | button3.Enabled = true; 56 | button4.Enabled = false; 57 | } 58 | 59 | private void Form1_FormClosing(object sender, FormClosingEventArgs e) 60 | { 61 | fClient.StopSendingMessages(); 62 | fClient.Stop(); 63 | } 64 | 65 | private void timer1_Tick(object sender, EventArgs e) 66 | { 67 | labelBytesIn.Text = fClient.BytesIn.ToString(); 68 | labelBytesOut.Text = fClient.BytesOut.ToString(); 69 | } 70 | 71 | 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys/Network/TCP/Client/Exceptions/ConnectorCannotSendPacketException.cs: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2008 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | using System; 21 | using System.Collections.Generic; 22 | using System.Linq; 23 | using System.Text; 24 | using Extasys.Network.TCP.Client.Connectors; 25 | using Extasys.Network.TCP.Client.Connectors.Packets; 26 | 27 | namespace Extasys.Network.TCP.Client.Exceptions 28 | { 29 | public class ConnectorCannotSendPacketException : Exception 30 | { 31 | private TCPConnector fConnector; 32 | private OutgoingTCPClientPacket fPacket; 33 | 34 | public ConnectorCannotSendPacketException(TCPConnector connector, OutgoingTCPClientPacket packet) 35 | : base("Connector is disconnected") 36 | { 37 | fConnector = connector; 38 | fPacket = packet; 39 | } 40 | 41 | /// 42 | /// Returns the connector was unable to send the packet. 43 | /// 44 | public TCPConnector ConnectorInstance 45 | { 46 | get { return fConnector; } 47 | } 48 | 49 | /// 50 | /// Returns the unsent packet. 51 | /// 52 | public OutgoingTCPClientPacket OutgoingPacket 53 | { 54 | get { return fPacket; } 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys/Network/DatagramPacket.cs: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2008 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | using System; 21 | using System.Collections.Generic; 22 | using System.Linq; 23 | using System.Text; 24 | using System.Net; 25 | 26 | namespace Extasys.Network 27 | { 28 | public class DatagramPacket 29 | { 30 | private byte[] fBytes; 31 | private int fLength; 32 | private IPEndPoint fServerIPEndPoint; 33 | 34 | public DatagramPacket(byte[] bytes, IPEndPoint serverIPEndPoint) 35 | { 36 | fBytes = bytes; 37 | fLength = bytes.Length; 38 | fServerIPEndPoint = serverIPEndPoint; 39 | } 40 | 41 | public DatagramPacket(byte[] bytes, int offset, int length, IPEndPoint serverIPEndPoint) 42 | { 43 | fBytes = new byte[length]; 44 | Buffer.BlockCopy(bytes, offset, fBytes, 0, length); 45 | fLength = length; 46 | fServerIPEndPoint = serverIPEndPoint; 47 | } 48 | 49 | public byte[] Bytes 50 | { 51 | get { return fBytes; } 52 | } 53 | 54 | public int Length 55 | { 56 | get { return fLength; } 57 | } 58 | 59 | public IPEndPoint ServerEndPoint 60 | { 61 | get { return fServerIPEndPoint; } 62 | } 63 | 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /Extasys for Java/src/Extasys/Network/TCP/Client/Exceptions/ConnectorCannotSendPacketException.java: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2008 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | package Extasys.Network.TCP.Client.Exceptions; 21 | 22 | import Extasys.Network.TCP.Client.Connectors.Packets.OutgoingTCPClientPacket; 23 | import Extasys.Network.TCP.Client.Connectors.TCPConnector; 24 | 25 | /** 26 | * 27 | * @author Nikos Siatras 28 | */ 29 | public final class ConnectorCannotSendPacketException extends Exception 30 | { 31 | 32 | private final TCPConnector fConnector; 33 | private final OutgoingTCPClientPacket fPacket; 34 | 35 | public ConnectorCannotSendPacketException(TCPConnector connector, OutgoingTCPClientPacket packet) 36 | { 37 | super("Connector is disconnected"); 38 | 39 | fConnector = connector; 40 | fPacket = packet; 41 | } 42 | 43 | /** 44 | * Returns the connector was unable to send the packet. 45 | * 46 | * @return the connector was unable to send the packet. 47 | */ 48 | public TCPConnector getConnectorInstance() 49 | { 50 | return fConnector; 51 | } 52 | 53 | /** 54 | * Returns the unsent packet. 55 | * 56 | * @return the unsent packet. 57 | */ 58 | public OutgoingTCPClientPacket getOutgoingPacket() 59 | { 60 | return fPacket; 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /Extasys for Java/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Builds, tests, and runs the project Extasys. 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Extasys", "Extasys\Extasys.csproj", "{2A003801-C61F-4007-BCD7-A1A91B0871D8}" 5 | EndProject 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Extasys.Examples.TCPServer", "Extasys.Examples.TCPServer\Extasys.Examples.TCPServer.csproj", "{CCA4BC13-CCD7-4F23-BBF4-09EBD51525BD}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Extasys.Examples.TCPClient", "Extasys.Examples.TCPClient\Extasys.Examples.TCPClient.csproj", "{4AA2275D-3EF7-4942-8B38-028E4405F421}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Extasys.Examples.UDPClient", "Extasys.Examples.UDPClient\Extasys.Examples.UDPClient.csproj", "{29415C58-CF3D-459A-9698-344AA3E87B63}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|Any CPU = Debug|Any CPU 15 | Release|Any CPU = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {2A003801-C61F-4007-BCD7-A1A91B0871D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {2A003801-C61F-4007-BCD7-A1A91B0871D8}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {2A003801-C61F-4007-BCD7-A1A91B0871D8}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {2A003801-C61F-4007-BCD7-A1A91B0871D8}.Release|Any CPU.Build.0 = Release|Any CPU 22 | {CCA4BC13-CCD7-4F23-BBF4-09EBD51525BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {CCA4BC13-CCD7-4F23-BBF4-09EBD51525BD}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {CCA4BC13-CCD7-4F23-BBF4-09EBD51525BD}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {CCA4BC13-CCD7-4F23-BBF4-09EBD51525BD}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {4AA2275D-3EF7-4942-8B38-028E4405F421}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {4AA2275D-3EF7-4942-8B38-028E4405F421}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {4AA2275D-3EF7-4942-8B38-028E4405F421}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {4AA2275D-3EF7-4942-8B38-028E4405F421}.Release|Any CPU.Build.0 = Release|Any CPU 30 | {29415C58-CF3D-459A-9698-344AA3E87B63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 31 | {29415C58-CF3D-459A-9698-344AA3E87B63}.Debug|Any CPU.Build.0 = Debug|Any CPU 32 | {29415C58-CF3D-459A-9698-344AA3E87B63}.Release|Any CPU.ActiveCfg = Release|Any CPU 33 | {29415C58-CF3D-459A-9698-344AA3E87B63}.Release|Any CPU.Build.0 = Release|Any CPU 34 | EndGlobalSection 35 | GlobalSection(SolutionProperties) = preSolution 36 | HideSolutionNode = FALSE 37 | EndGlobalSection 38 | EndGlobal 39 | -------------------------------------------------------------------------------- /Extasys for Java/src/Extasys/ManualResetEvent.java: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2024 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | package Extasys; 21 | 22 | /** 23 | * 24 | * @author Nikos Siatras 25 | */ 26 | public class ManualResetEvent 27 | { 28 | 29 | private final Object fLock = new Object(); 30 | private volatile boolean fIsOpen; 31 | 32 | public ManualResetEvent(boolean initialState) 33 | { 34 | fIsOpen = initialState; 35 | } 36 | 37 | public void Reset() 38 | { 39 | fIsOpen = false; 40 | } 41 | 42 | public void WaitOne() 43 | { 44 | synchronized (fLock) 45 | { 46 | while (!fIsOpen) 47 | { 48 | try 49 | { 50 | fLock.wait(); 51 | } 52 | catch (InterruptedException ex) 53 | { 54 | } 55 | } 56 | } 57 | } 58 | 59 | public boolean WaitOne(long milliseconds) throws InterruptedException 60 | { 61 | synchronized (fLock) 62 | { 63 | if (fIsOpen) 64 | { 65 | return true; 66 | } 67 | 68 | fLock.wait(milliseconds); 69 | return fIsOpen; 70 | } 71 | } 72 | 73 | public void Set() 74 | { 75 | synchronized (fLock) 76 | { 77 | fIsOpen = true; 78 | fLock.notifyAll(); 79 | } 80 | } 81 | 82 | public boolean getState() 83 | { 84 | return fIsOpen; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.UDPServer/src/Extasys/Examples/UDPServer/UDPServer.java: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2008 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | package Extasys.Examples.UDPServer; 21 | 22 | import Extasys.DataConvertion.Base64Converter; 23 | import Extasys.Network.UDP.Server.Listener.UDPListener; 24 | import java.net.DatagramPacket; 25 | import java.net.InetAddress; 26 | 27 | /** 28 | * 29 | * @author Nikos Siatras 30 | */ 31 | public class UDPServer extends Extasys.Network.UDP.Server.ExtasysUDPServer 32 | { 33 | 34 | public UDPServer(String name, String description, InetAddress listenerIP, int port, int connectionsTimeOut, int corePoolSize, int maximumPoolSize) 35 | { 36 | super(name, description, corePoolSize, maximumPoolSize); 37 | UDPListener listener = this.AddListener("My UDP Listener", listenerIP, port, 10240, connectionsTimeOut); 38 | 39 | // Uncomment the following line to set a DataConverter for this UDPListener 40 | listener.setConnectionDataConverter(new Base64Converter()); 41 | } 42 | 43 | @Override 44 | public void OnDataReceive(UDPListener listener, DatagramPacket packet) 45 | { 46 | System.out.println("Data received from " + packet.getAddress().toString() + ": " + new String(packet.getData())); 47 | 48 | try 49 | { 50 | // Send data back to the sender. 51 | listener.SendData(new DatagramPacket(packet.getData(), 0, packet.getLength(), packet.getAddress(), packet.getPort())); 52 | } 53 | catch (Exception ex) 54 | { 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys/Extasys/Extasys.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 9.0.30729 7 | 2.0 8 | {2A003801-C61F-4007-BCD7-A1A91B0871D8} 9 | Library 10 | Properties 11 | Extasys 12 | Extasys 13 | v3.5 14 | 512 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | 33 | 34 | 35 | 36 | 3.5 37 | 38 | 39 | 3.5 40 | 41 | 42 | 3.5 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 59 | -------------------------------------------------------------------------------- /Extasys for Java/src/Extasys/Network/TCP/Server/Listener/TCPListenerThread.java: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2008 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | package Extasys.Network.TCP.Server.Listener; 21 | 22 | import java.io.IOException; 23 | import java.net.ServerSocket; 24 | import java.net.SocketException; 25 | import java.net.SocketTimeoutException; 26 | 27 | /** 28 | * 29 | * @author Nikos Siatras 30 | */ 31 | public class TCPListenerThread implements Runnable 32 | { 33 | 34 | private final ServerSocket fSocket; 35 | private final TCPListener fMyListener; 36 | 37 | public TCPListenerThread(ServerSocket socket, TCPListener myListener) 38 | { 39 | fSocket = socket; 40 | fMyListener = myListener; 41 | } 42 | 43 | @Override 44 | public void run() 45 | { 46 | while (fMyListener.isActive()) 47 | { 48 | try 49 | { 50 | final TCPClientConnection client = new TCPClientConnection(fSocket.accept(), fMyListener, fMyListener.isUsingMessageCollector(), fMyListener.getMessageETX()); 51 | if (fMyListener.getConnectedClients().size() >= fMyListener.getMaxConnections()) 52 | { 53 | client.DisconnectMe(); 54 | } 55 | } 56 | catch (SocketTimeoutException ex) 57 | { 58 | } 59 | catch (SocketException ex) 60 | { 61 | } 62 | catch (SecurityException | IOException ex) 63 | { 64 | } 65 | } 66 | 67 | //System.out.println("Listener thread interrupted."); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /Extasys for Java/src/Extasys/DataConvertion/Base64Converter.java: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2024 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | package Extasys.DataConvertion; 21 | 22 | import java.util.Base64; 23 | import java.util.Base64.Decoder; 24 | import java.util.Base64.Encoder; 25 | 26 | /** 27 | * 28 | * @author Nikos Siatras 29 | */ 30 | public class Base64Converter extends DataConverter 31 | { 32 | 33 | private final Encoder fEncoder; 34 | private final Decoder fDecoder; 35 | 36 | public Base64Converter() 37 | { 38 | fEncoder = Base64.getEncoder(); 39 | fDecoder = Base64.getDecoder(); 40 | } 41 | 42 | /** 43 | * Encodes all bytes from the specified byte array into a newly-allocated 44 | * byte array using the Base64 encoding scheme. The returned byte 45 | * array is of the length of the resulting bytes. 46 | * 47 | * @param bytes 48 | * @return A newly-allocated byte array containing the resulting encoded 49 | * bytes. 50 | */ 51 | @Override 52 | public byte[] Convert(final byte[] bytes) 53 | { 54 | return fEncoder.encode(bytes); 55 | } 56 | 57 | /** 58 | * Decodes all bytes from the input byte array using the {@link Base64} 59 | * encoding scheme, writing the results into a newly-allocated output byte 60 | * array. The returned byte array is of the length of the resulting bytes. 61 | * 62 | * @param bytes 63 | * @return A newly-allocated byte array containing the decoded bytes. 64 | */ 65 | @Override 66 | public byte[] Revert(final byte[] bytes) 67 | { 68 | return fDecoder.decode(bytes); 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.TCPChatClient/src/Extasys/Examples/TCPChatClient/MessageToken.java: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2008 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | package Extasys.Examples.TCPChatClient; 21 | 22 | import com.google.gson.Gson; 23 | import com.google.gson.reflect.TypeToken; 24 | import java.lang.reflect.Type; 25 | import java.util.HashMap; 26 | 27 | /** 28 | * 29 | * @author Nikos Siatras - https://github.com/nsiatras 30 | */ 31 | public class MessageToken 32 | { 33 | 34 | private final String fHeader; 35 | private final String fData; 36 | 37 | public MessageToken(String header, String data) 38 | { 39 | fHeader = header; 40 | fData = data; 41 | } 42 | 43 | /** 44 | * Serialize this Object to JSON 45 | * 46 | * @return 47 | */ 48 | public String toJSON() 49 | { 50 | Gson gson = new Gson(); 51 | HashMap map = new HashMap<>(); 52 | map.put("H", fHeader); 53 | map.put("D", fData); 54 | 55 | return gson.toJson(map); 56 | } 57 | 58 | public static MessageToken fromJSON(String jsonString) 59 | { 60 | Gson gson = new Gson(); 61 | Type type = new TypeToken>() 62 | { 63 | }.getType(); 64 | 65 | // Deserialize το JSON string σε HashMap 66 | HashMap map = gson.fromJson(jsonString, type); 67 | 68 | return new MessageToken(map.get("H"), map.get("D")); 69 | } 70 | 71 | /** 72 | * Returns the Header 73 | * 74 | * @return 75 | */ 76 | public String getHeader() 77 | { 78 | return fHeader; 79 | } 80 | 81 | /** 82 | * Returns the Data 83 | * 84 | * @return 85 | */ 86 | public String getData() 87 | { 88 | return fData; 89 | } 90 | 91 | } 92 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.TCPChatServer/src/Extasys/Examples/TCPChatServer/MessageToken.java: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2008 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | package Extasys.Examples.TCPChatServer; 21 | 22 | import com.google.gson.Gson; 23 | import com.google.gson.reflect.TypeToken; 24 | import java.lang.reflect.Type; 25 | import java.util.HashMap; 26 | 27 | /** 28 | * 29 | * @author Nikos Siatras - https://github.com/nsiatras 30 | */ 31 | public class MessageToken 32 | { 33 | 34 | private final String fHeader; 35 | private final String fData; 36 | 37 | public MessageToken(String header, String data) 38 | { 39 | fHeader = header; 40 | fData = data; 41 | } 42 | 43 | /** 44 | * Serialize this Object to JSON 45 | * 46 | * @return 47 | */ 48 | public String toJSON() 49 | { 50 | Gson gson = new Gson(); 51 | HashMap map = new HashMap<>(); 52 | map.put("H", fHeader); 53 | map.put("D", fData); 54 | 55 | return gson.toJson(map); 56 | } 57 | 58 | public static MessageToken fromJSON(String jsonString) 59 | { 60 | Gson gson = new Gson(); 61 | Type type = new TypeToken>() 62 | { 63 | }.getType(); 64 | 65 | // Deserialize το JSON string σε HashMap 66 | HashMap map = gson.fromJson(jsonString, type); 67 | 68 | return new MessageToken(map.get("H"), map.get("D")); 69 | } 70 | 71 | /** 72 | * Returns the Header 73 | * 74 | * @return 75 | */ 76 | public String getHeader() 77 | { 78 | return fHeader; 79 | } 80 | 81 | /** 82 | * Returns the Data 83 | * 84 | * @return 85 | */ 86 | public String getData() 87 | { 88 | return fData; 89 | } 90 | 91 | } 92 | -------------------------------------------------------------------------------- /Extasys for Java/src/Extasys/ExtasysThreadPool.java: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2008 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | package Extasys; 21 | 22 | import Extasys.Network.NetworkPacket; 23 | import java.util.concurrent.LinkedBlockingQueue; 24 | import java.util.concurrent.ThreadPoolExecutor; 25 | import java.util.concurrent.TimeUnit; 26 | 27 | /** 28 | * 29 | * @author Nikos Siatras 30 | * 31 | */ 32 | public class ExtasysThreadPool extends ThreadPoolExecutor 33 | { 34 | 35 | // private final BlockingQueue fPoolsQueue; 36 | public ExtasysThreadPool(int corePoolWorkers, int maximumPoolWorkers) 37 | { 38 | //super(corePoolSize, maximumPoolSize, keepAliveTime, unit, new ArrayBlockingQueue(250000, true)); 39 | 40 | // It appears that LinkedBlockingQueue has better performance than the ArrayBlockingQueue 41 | super(corePoolWorkers, maximumPoolWorkers, 10, TimeUnit.SECONDS, new LinkedBlockingQueue(100000)); 42 | //fPoolsQueue = this.getQueue(); 43 | 44 | this.prestartAllCoreThreads(); 45 | } 46 | 47 | public void EnqueNetworkPacket(NetworkPacket packet) 48 | { 49 | super.execute(packet); 50 | 51 | // TODO: To be tested ! 52 | /*try 53 | { 54 | synchronized (fPoolsQueue) 55 | { 56 | // The following while statement ensures that there is enough 57 | // space to the ThreadPool's queue in order to enqueue the 58 | // NetworkPacket (Runnable). 59 | while (fPoolsQueue.remainingCapacity() < 500) 60 | { 61 | fPoolsQueue.wait(); // Wait until space is freed up in the queue 62 | } 63 | 64 | super.execute(packet); 65 | 66 | } 67 | } 68 | catch (InterruptedException ex) 69 | { 70 | Thread.currentThread().interrupt(); 71 | }*/ 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys.Examples.TCPClient/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.1 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Extasys.Examples.TCPClient.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Extasys.Examples.TCPClient.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys.Examples.TCPServer/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.1 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Extasys.Examples.TCPServer.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Extasys.Examples.TCPServer.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys.Examples.UDPClient/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.1 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Extasys.Examples.UDPClient.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Extasys.Examples.UDPClient.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Extasys for Java/src/Extasys/Network/UDP/Server/Listener/Packets/OutgoingUDPServerPacket.java: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2008 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | package Extasys.Network.UDP.Server.Listener.Packets; 21 | 22 | import Extasys.Network.UDP.Server.Listener.UDPListener; 23 | 24 | import Extasys.Network.NetworkPacket; 25 | import java.net.DatagramPacket; 26 | 27 | /** 28 | * 29 | * @author Nikos Siatras 30 | */ 31 | public class OutgoingUDPServerPacket extends NetworkPacket 32 | { 33 | 34 | private final UDPListener fMyListener; 35 | private final DatagramPacket fDataGram; 36 | 37 | public OutgoingUDPServerPacket(UDPListener listener, DatagramPacket packet, NetworkPacket previousPacket) 38 | { 39 | super(packet.getData(), previousPacket); 40 | fMyListener = listener; 41 | fDataGram = packet; 42 | 43 | listener.getMyExtasysUDPServer().getMyThreadPool().EnqueNetworkPacket(this); 44 | } 45 | 46 | @Override 47 | public void run() 48 | { 49 | try 50 | { 51 | // Wait for previous Packet to be processed 52 | // by the thread pool. 53 | super.WaitForPreviousPacketToBeProcessedAndCheckIfItWasCanceled(); 54 | 55 | // Converter outgoing data 56 | byte[] convertedData = fMyListener.getConnectionDataConverter().Convert(fDataGram.getData()); 57 | fDataGram.setData(convertedData, 0, convertedData.length); 58 | 59 | if (!fCancel) 60 | { 61 | fMyListener.fSocket.send(fDataGram); 62 | fMyListener.fBytesOut += fDataGram.getLength(); 63 | fMyListener.getMyExtasysUDPServer().fTotalBytesOut += fDataGram.getLength(); 64 | } 65 | 66 | } 67 | catch (Exception ex) 68 | { 69 | } 70 | 71 | // Mark previous Packet as null. 72 | // GC will take it out later... 73 | fPreviousPacket = null; 74 | 75 | fDone.Set(); 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys.Examples.TCPClient/TCPClient.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading; 6 | using Extasys.Network.TCP.Client.Exceptions; 7 | 8 | namespace Extasys.Examples.TCPClient 9 | { 10 | public class TCPClient:Extasys.Network.TCP.Client.ExtasysTCPClient 11 | { 12 | private Thread fAutoSendMessages; 13 | public TCPClient(string name,string description) 14 | :base(name,description) 15 | { 16 | } 17 | 18 | public override void OnDataReceive(Extasys.Network.TCP.Client.Connectors.TCPConnector connector, Extasys.Network.DataFrame data) 19 | { 20 | string dataReceived = Encoding.ASCII.GetString(data.Bytes); 21 | 22 | } 23 | 24 | public override void OnConnect(Extasys.Network.TCP.Client.Connectors.TCPConnector connector) 25 | { 26 | Console.WriteLine("Connected to server"); 27 | } 28 | 29 | public override void OnDisconnect(Extasys.Network.TCP.Client.Connectors.TCPConnector connector) 30 | { 31 | Console.WriteLine("Disconnected from server"); 32 | } 33 | 34 | public void StartSendingMessages() 35 | { 36 | if (fAutoSendMessages == null) 37 | { 38 | fAutoSendMessages = new Thread(new ThreadStart(AutoSendMessages)); 39 | fAutoSendMessages.Start(); 40 | } 41 | else 42 | { 43 | fAutoSendMessages.Abort(); 44 | fAutoSendMessages = new Thread(new ThreadStart(AutoSendMessages)); 45 | fAutoSendMessages.Start(); 46 | } 47 | } 48 | 49 | public void StopSendingMessages() 50 | { 51 | try 52 | { 53 | fAutoSendMessages.Abort(); 54 | } 55 | catch (Exception ex) 56 | { 57 | } 58 | } 59 | 60 | private void AutoSendMessages() 61 | { 62 | int messageCount = 0; 63 | while (true) 64 | { 65 | try 66 | { 67 | messageCount++; 68 | SendData(messageCount.ToString() + ((char)2)); // Char 2 is the message splitter the server's message collector uses. 69 | Thread.Sleep(2); 70 | } 71 | catch (ConnectorDisconnectedException ex) 72 | { 73 | Console.WriteLine(ex.ConnectorInstance.Name + " connector disconnected!"); 74 | StopSendingMessages(); 75 | } 76 | catch (ConnectorCannotSendPacketException ex) 77 | { 78 | Console.WriteLine("Connector " + ex.ConnectorInstance.Name + " cannot send packet"); 79 | StopSendingMessages(); 80 | } 81 | catch (Exception ex) 82 | { 83 | StopSendingMessages(); 84 | } 85 | } 86 | } 87 | 88 | 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys/Network/UDP/Client/Connectors/Packets/IncomingUDPClientPacket.cs: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2008 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | using System; 21 | using System.Collections.Generic; 22 | using System.Linq; 23 | using System.Text; 24 | using System.Threading; 25 | 26 | namespace Extasys.Network.UDP.Client.Connectors.Packets 27 | { 28 | public class IncomingUDPClientPacket 29 | { 30 | public ManualResetEvent fDone = new ManualResetEvent(false); 31 | private UDPConnector fConnector; 32 | private DatagramPacket fData; 33 | private IncomingUDPClientPacket fPreviousPacket; 34 | public bool fCancel = false; 35 | 36 | public IncomingUDPClientPacket(UDPConnector connector, DatagramPacket data, IncomingUDPClientPacket previousPacket) 37 | { 38 | fConnector = connector; 39 | fData = data; 40 | fPreviousPacket = previousPacket; 41 | connector.fBytesIn += data.Length; 42 | ThreadPool.QueueUserWorkItem(new WaitCallback(ReadData)); 43 | } 44 | 45 | public void Cancel() 46 | { 47 | fCancel = true; 48 | fDone.Set(); 49 | } 50 | 51 | private void ReadData(object stateObject) 52 | { 53 | try 54 | { 55 | if (fPreviousPacket == null) 56 | { 57 | fConnector.MyExtasysUDPClient.OnDataReceive(fConnector, fData); 58 | } 59 | else 60 | { 61 | fPreviousPacket.fDone.WaitOne(); 62 | if (!fCancel && !fPreviousPacket.fCancel) 63 | { 64 | fConnector.MyExtasysUDPClient.OnDataReceive(fConnector, fData); 65 | } 66 | else 67 | { 68 | fCancel = true; 69 | } 70 | } 71 | } 72 | catch (Exception ex) 73 | { 74 | } 75 | 76 | if (fPreviousPacket != null) 77 | { 78 | fPreviousPacket = null; 79 | } 80 | 81 | fDone.Set(); 82 | } 83 | 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /Extasys for Java/src/Extasys/Network/NetworkPacket.java: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2024 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | package Extasys.Network; 21 | 22 | import Extasys.ManualResetEvent; 23 | 24 | /** 25 | * 26 | * @author Nikos Siatras 27 | */ 28 | public abstract class NetworkPacket implements Runnable 29 | { 30 | 31 | public final ManualResetEvent fDone = new ManualResetEvent(false); 32 | public final byte[] fPacketsData; 33 | public NetworkPacket fPreviousPacket; 34 | public volatile boolean fCancel = false; 35 | 36 | public NetworkPacket(final byte[] data, final NetworkPacket previousPacket) 37 | { 38 | fPacketsData = data; 39 | fPreviousPacket = previousPacket; 40 | } 41 | 42 | @Override 43 | public abstract void run(); 44 | 45 | /** 46 | * This method waits until this packet is processed by the Thread Pool. It 47 | * also checks if the previous packet was Canceled in order to mark it self 48 | * as canceled too. 49 | */ 50 | public void WaitForPreviousPacketToBeProcessedAndCheckIfItWasCanceled() 51 | { 52 | if (fPreviousPacket != null) 53 | { 54 | fPreviousPacket.fDone.WaitOne(); 55 | 56 | // Previous packet was canceled. 57 | // That means this packet must be canceled too! 58 | if (fPreviousPacket.fCancel) 59 | { 60 | fCancel = true; 61 | } 62 | } 63 | } 64 | 65 | /** 66 | * Cancel this network packet. 67 | * 68 | * Calling this method marks this and its previous NetworkPacket as 69 | * Canceled. Call this method for the last incoming packet of a connection 70 | * when the connection drops. 71 | */ 72 | public void Cancel() 73 | { 74 | fCancel = true; 75 | 76 | if (fPreviousPacket != null) 77 | { 78 | fPreviousPacket.Cancel(); 79 | } 80 | } 81 | 82 | protected byte[] Combine2ByteArrays(byte[] first, byte[] second) 83 | { 84 | byte[] combined = new byte[first.length + second.length]; 85 | System.arraycopy(first, 0, combined, 0, first.length); 86 | System.arraycopy(second, 0, combined, first.length, second.length); 87 | return combined; 88 | } 89 | 90 | } 91 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Extasys - Asynchronous TCP/UDP socket library 2 | ======= 3 | 4 | Extasys is a high performance, **asynchronous TCP/UDP socket library** for Java (JDK 8 and newer).
Its **multi-threaded and lightweight** nature makes it ideal for super fast data transfer even on systems with ARM architecture like Android smartphones and single-board computers (Raspberry Pi, Orange Pi etc.). 5 | Extasys is designed to take the hard job done and let you think only about the message exchange (the process). 6 | 7 | 8 | 9 | ```mermaid 10 | flowchart TD; 11 | 12 | Client1(Client #1) ---|Data I/O|ExtasysListener(Extasys Listener); 13 | Client2(Client #2) ---|Data I/O|ExtasysListener(Extasys Listener); 14 | Client3(Client #3) ---|Data I/O|ExtasysListener(Extasys Listener); 15 | Client...(Client ...) ---|Data I/O|ExtasysListener(Extasys Listener); 16 | 17 | ExtasysListener --> ThreadPool(ThreadPool: Non-Blocking Multithreaded Data Processing); 18 | ThreadPool --> ExtasysListener; 19 | 20 | ``` 21 | 22 | #### Features 23 | * Dedicated Thread Pool for each TCPServer, TCPClient, UDPServer and UDPClient 24 | * Multiple listeners per server and multiple connectors per Client 25 | * TCP message collector with character or string message splitter 26 | * Auto-Handle Message Splitter characters for TCP connections 27 | * On-the-Fly Data Manipulations (Encryption, Encoding, Compression) using the [DataConverter](https://github.com/nsiatras/extasys/blob/master/Extasys%20for%20Java/src/Extasys/DataConvertion/DataConverter.java) object 28 | 29 | Extasys project is Developed with NetBeans IDE 30 | 31 | 32 | 33 | ## How to Use 34 | 35 | Fully functional examples on how to use Extasys can be found [inside the repository](https://github.com/nsiatras/extasys/tree/master/Extasys%20for%20Java%20Examples).
36 | More information on how to use Extasys can be found on the [wiki pages](https://github.com/nsiatras/extasys/wiki) 37 | 38 | #### Easy to follow examples: 39 | * [TCP Server Example](https://github.com/nsiatras/extasys/tree/master/Extasys%20for%20Java%20Examples/Extasys.Examples.TCPServer) - Simple TCP Server with UI 40 | * [TCP Client Example ](https://github.com/nsiatras/extasys/tree/master/Extasys%20for%20Java%20Examples/Extasys.Examples.TCPClient) - Simple TCP Client with UI 41 | * [UDP Server Example ](https://github.com/nsiatras/extasys/tree/master/Extasys%20for%20Java%20Examples/Extasys.Examples.UDPServer) - Simple UDP Server with UI 42 | * [UDP Client Example ](https://github.com/nsiatras/extasys/tree/master/Extasys%20for%20Java%20Examples/Extasys.Examples.UDPClient) - Simple UDP Client with UI 43 | 44 | #### Chat Server client examples: 45 | * [TCP Chat Server Example](https://github.com/nsiatras/extasys/tree/master/Extasys%20for%20Java%20Examples/Extasys.Examples.TCPChatServer) - Chat Server Example with UI 46 | * [TCP Chat Client Example](https://github.com/nsiatras/extasys/tree/master/Extasys%20for%20Java%20Examples/Extasys.Examples.TCPChatClient) - Chat Client Example with UI 47 | 48 | 49 | #### Quick Examples: 50 | * [Establish a TCP Server](https://github.com/nsiatras/extasys/wiki/Establish-a-TCP-Server) 51 | * [Establish a TCP Client](https://github.com/nsiatras/extasys/wiki/Establish-a-TCP-Client) 52 | * [Establish a UDP Server](https://github.com/nsiatras/extasys/wiki/Establish-a-UDP-Server) 53 | * [Establish a UDP Client](https://github.com/nsiatras/extasys/wiki/Establish-a-UDP-Client) 54 | -------------------------------------------------------------------------------- /Extasys for Java/nbproject/project.properties: -------------------------------------------------------------------------------- 1 | annotation.processing.enabled=true 2 | annotation.processing.enabled.in.editor=false 3 | annotation.processing.processors.list= 4 | annotation.processing.run.all.processors=true 5 | annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output 6 | application.desc=High performance, Asynchronous TCP/UDP Socket Library 7 | application.homepage=https://github.com/nsiatras/extasys 8 | application.title=Extasys 9 | application.vendor=Nikos Siatras 10 | build.classes.dir=${build.dir}/classes 11 | build.classes.excludes=**/*.java,**/*.form 12 | # This directory is removed when the project is cleaned: 13 | build.dir=build 14 | build.generated.dir=${build.dir}/generated 15 | build.generated.sources.dir=${build.dir}/generated-sources 16 | # Only compile against the classpath explicitly listed here: 17 | build.sysclasspath=ignore 18 | build.test.classes.dir=${build.dir}/test/classes 19 | build.test.results.dir=${build.dir}/test/results 20 | # Uncomment to specify the preferred debugger connection transport: 21 | #debug.transport=dt_socket 22 | debug.classpath=\ 23 | ${run.classpath} 24 | debug.modulepath=\ 25 | ${run.modulepath} 26 | debug.test.classpath=\ 27 | ${run.test.classpath} 28 | debug.test.modulepath=\ 29 | ${run.test.modulepath} 30 | # Files in build.classes.dir which should be excluded from distribution jar 31 | dist.archive.excludes= 32 | # This directory is removed when the project is cleaned: 33 | dist.dir=dist 34 | dist.jar=${dist.dir}/Extasys.jar 35 | dist.javadoc.dir=${dist.dir}/javadoc 36 | dist.jlink.dir=${dist.dir}/jlink 37 | dist.jlink.output=${dist.jlink.dir}/Extasys 38 | endorsed.classpath= 39 | excludes= 40 | includes=** 41 | jar.compress=false 42 | javac.classpath= 43 | # Space-separated list of extra javac options 44 | javac.compilerargs= 45 | javac.deprecation=false 46 | javac.external.vm=true 47 | javac.modulepath= 48 | javac.processormodulepath= 49 | javac.processorpath=\ 50 | ${javac.classpath} 51 | javac.source=1.8 52 | javac.target=1.8 53 | javac.test.classpath=\ 54 | ${javac.classpath}:\ 55 | ${build.classes.dir} 56 | javac.test.modulepath=\ 57 | ${javac.modulepath} 58 | javac.test.processorpath=\ 59 | ${javac.test.classpath} 60 | javadoc.additionalparam= 61 | javadoc.author=false 62 | javadoc.encoding=${source.encoding} 63 | javadoc.html5=false 64 | javadoc.noindex=false 65 | javadoc.nonavbar=false 66 | javadoc.notree=false 67 | javadoc.private=false 68 | javadoc.splitindex=true 69 | javadoc.use=true 70 | javadoc.version=false 71 | javadoc.windowtitle= 72 | # The jlink additional root modules to resolve 73 | jlink.additionalmodules= 74 | # The jlink additional command line parameters 75 | jlink.additionalparam= 76 | jlink.launcher=true 77 | jlink.launcher.name=Extasys 78 | meta.inf.dir=${src.dir}/META-INF 79 | mkdist.disabled=true 80 | platform.active=default_platform 81 | run.classpath=\ 82 | ${javac.classpath}:\ 83 | ${build.classes.dir} 84 | # Space-separated list of JVM arguments used when running the project. 85 | # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. 86 | # To set system properties for unit tests define test-sys-prop.name=value: 87 | run.jvmargs= 88 | run.modulepath=\ 89 | ${javac.modulepath} 90 | run.test.classpath=\ 91 | ${javac.test.classpath}:\ 92 | ${build.test.classes.dir} 93 | run.test.modulepath=\ 94 | ${javac.test.modulepath} 95 | source.encoding=UTF-8 96 | src.dir=src 97 | test.src.dir=test 98 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys/Network/TCP/Server/Listener/Tools/TCPClientConnectionMessageCollector.cs: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2008 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | using System; 21 | using System.Collections.Generic; 22 | using System.Linq; 23 | using System.Text; 24 | 25 | namespace Extasys.Network.TCP.Server.Listener.Tools 26 | { 27 | public class TCPClientConnectionMessageCollector 28 | { 29 | private TCPClientConnection fMyClient; 30 | private String fETXStr; 31 | private StringBuilder fIncomingDataBuffer; 32 | private int fIndexOfETX; 33 | private int fETXLength = 0; 34 | 35 | public TCPClientConnectionMessageCollector(TCPClientConnection myClient, char splitter) 36 | { 37 | Initialize(myClient, splitter.ToString()); 38 | fETXLength = 1; 39 | } 40 | 41 | public TCPClientConnectionMessageCollector(TCPClientConnection myClient, string splitter) 42 | { 43 | Initialize(myClient, splitter); 44 | fETXLength = splitter.Length; 45 | } 46 | 47 | private void Initialize(TCPClientConnection myClient, string splitter) 48 | { 49 | fMyClient = myClient; 50 | fETXStr = splitter; 51 | fIncomingDataBuffer = new StringBuilder(); 52 | } 53 | 54 | public void AppendData(string data) 55 | { 56 | try 57 | { 58 | fIncomingDataBuffer.Append(data); 59 | fIndexOfETX = fIncomingDataBuffer.ToString().IndexOf(fETXStr); 60 | while (fIndexOfETX > -1) 61 | { 62 | fMyClient.MyTCPListener.MyExtasysTCPServer.OnDataReceive(fMyClient, new DataFrame(Encoding.Default.GetBytes(fIncomingDataBuffer.ToString().Substring(0, fIndexOfETX)))); 63 | fIncomingDataBuffer = fIncomingDataBuffer.Remove(0, fIndexOfETX + fETXLength); 64 | fIndexOfETX = fIncomingDataBuffer.ToString().IndexOf(fETXStr); 65 | } 66 | } 67 | catch (Exception ex) 68 | { 69 | } 70 | } 71 | 72 | public void Dispose() 73 | { 74 | try 75 | { 76 | fIncomingDataBuffer = null; 77 | fETXStr = null; 78 | fMyClient = null; 79 | } 80 | catch (Exception ex) 81 | { 82 | } 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys/Network/TCP/Client/Connectors/Tools/TCPClientMessageCollector.cs: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2008 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | using System; 21 | using System.Collections.Generic; 22 | using System.Linq; 23 | using System.Text; 24 | 25 | namespace Extasys.Network.TCP.Client.Connectors.Tools 26 | { 27 | public class TCPClientMessageCollector 28 | { 29 | private TCPConnector fMyConnector; 30 | private String fETXStr; 31 | private StringBuilder fIncomingDataBuffer; 32 | private int fIndexOfETX; 33 | private int fETXLength = 0; 34 | 35 | public TCPClientMessageCollector(TCPConnector connector, char ETX) 36 | { 37 | Initialize(connector, ETX.ToString()); 38 | fETXLength = 1; 39 | } 40 | 41 | public TCPClientMessageCollector(TCPConnector connector, string splitter) 42 | { 43 | Initialize(connector, splitter); 44 | fETXLength = splitter.Length; 45 | } 46 | 47 | private void Initialize(TCPConnector connector, string splitter) 48 | { 49 | fMyConnector = connector; 50 | fETXStr = splitter; 51 | fIncomingDataBuffer = new StringBuilder(); 52 | } 53 | 54 | public void AppendData(string data) 55 | { 56 | try 57 | { 58 | fIncomingDataBuffer.Append(data); 59 | fIndexOfETX = fIncomingDataBuffer.ToString().IndexOf(fETXStr); 60 | 61 | while (fIndexOfETX > -1) 62 | { 63 | string tmp = fIncomingDataBuffer.ToString().Substring(0, fIndexOfETX); 64 | fMyConnector.MyExtasysTCPClient.OnDataReceive(fMyConnector, new DataFrame(Encoding.Default.GetBytes(fIncomingDataBuffer.ToString().Substring(0, fIndexOfETX)))); 65 | fIncomingDataBuffer = fIncomingDataBuffer.Remove(0, fIndexOfETX + fETXLength); 66 | fIndexOfETX = fIncomingDataBuffer.ToString().IndexOf(fETXStr); 67 | } 68 | } 69 | catch (Exception ex) 70 | { 71 | } 72 | } 73 | 74 | public void Dispose() 75 | { 76 | try 77 | { 78 | fIncomingDataBuffer = null; 79 | fETXStr = null; 80 | fMyConnector = null; 81 | } 82 | catch (Exception ex) 83 | { 84 | } 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys.Examples.UDPClient/Form1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Windows.Forms; 9 | using System.Net; 10 | using System.Threading; 11 | 12 | namespace Extasys.Examples.UDPClient 13 | { 14 | public partial class Form1 : Form 15 | { 16 | private UDPClient fClient = new UDPClient("", ""); 17 | private Thread fKeepSendingMessagesThread; 18 | 19 | public Form1() 20 | { 21 | InitializeComponent(); 22 | } 23 | 24 | private void buttonStartClient_Click(object sender, EventArgs e) 25 | { 26 | fClient.RemoveConnector("a"); 27 | fClient.AddConnector("a", 65535, int.Parse(textBoxReadTimeOut.Text), IPAddress.Parse(textBoxIP.Text), int.Parse(textBoxPort.Text)); 28 | fClient.Start(); 29 | 30 | buttonStartClient.Enabled = false; 31 | buttonStopClient.Enabled = true; 32 | buttonStartSendingMessages.Enabled = true; 33 | buttonStopSendingMessages.Enabled = false; 34 | } 35 | 36 | private void buttonStopClient_Click(object sender, EventArgs e) 37 | { 38 | fClient.Stop(); 39 | 40 | buttonStartClient.Enabled = true; 41 | buttonStopClient.Enabled = false; 42 | buttonStartSendingMessages.Enabled = false; 43 | buttonStopSendingMessages.Enabled = false; 44 | 45 | if (fKeepSendingMessagesThread != null) 46 | { 47 | try 48 | { 49 | fKeepSendingMessagesThread.Abort(); 50 | } 51 | catch (Exception ex) 52 | { 53 | 54 | } 55 | } 56 | } 57 | 58 | private void buttonStartSendingMessages_Click(object sender, EventArgs e) 59 | { 60 | fKeepSendingMessagesThread = new Thread(new ThreadStart(KeepSendingMessages)); 61 | fKeepSendingMessagesThread.Start(); 62 | 63 | buttonStartSendingMessages.Enabled = false; 64 | buttonStopSendingMessages.Enabled = true; 65 | } 66 | 67 | private void KeepSendingMessages() 68 | { 69 | while (true) 70 | { 71 | byte[] bytes = Encoding.Default.GetBytes(DateTime.Now.Ticks.ToString()); 72 | fClient.SendData(bytes,0,bytes.Length); 73 | Thread.Sleep(5); 74 | } 75 | } 76 | 77 | private void buttonStopSendingMessages_Click(object sender, EventArgs e) 78 | { 79 | if (fKeepSendingMessagesThread != null) 80 | { 81 | try 82 | { 83 | fKeepSendingMessagesThread.Abort(); 84 | } 85 | catch (Exception ex) 86 | { 87 | 88 | } 89 | } 90 | 91 | buttonStartSendingMessages.Enabled = true; 92 | buttonStopSendingMessages.Enabled = false; 93 | } 94 | 95 | private void timer1_Tick(object sender, EventArgs e) 96 | { 97 | if (fClient != null) 98 | { 99 | labelBytesIn.Text = fClient.BytesIn.ToString(); 100 | labelBytesOut.Text = fClient.BytesOut.ToString(); 101 | } 102 | } 103 | 104 | 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /Extasys for Java/src/Extasys/Network/UDP/Server/Listener/Packets/IncomingUDPServerPacket.java: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2008 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | package Extasys.Network.UDP.Server.Listener.Packets; 21 | 22 | import Extasys.Network.UDP.Server.Listener.UDPListener; 23 | 24 | import Extasys.Network.NetworkPacket; 25 | import java.net.DatagramPacket; 26 | import java.util.Arrays; 27 | 28 | /** 29 | * 30 | * @author Nikos Siatras 31 | */ 32 | public class IncomingUDPServerPacket extends NetworkPacket 33 | { 34 | 35 | private final UDPListener fMyListener; 36 | private final DatagramPacket fDataGram; 37 | 38 | /** 39 | * Constructs a new incoming UDP packet. 40 | * 41 | * Use this class to receive data from a client. This is an incoming message 42 | * that will remain in the servers thread pool as a job for the thread pool 43 | * workers. 44 | * 45 | * @param listener is the listener caught the message. 46 | * @param packet is a Datagram packet. 47 | * @param previousPacket is the previous incoming message of the listener. 48 | */ 49 | public IncomingUDPServerPacket(UDPListener listener, DatagramPacket packet, NetworkPacket previousPacket) 50 | { 51 | super(packet.getData(), previousPacket); 52 | fMyListener = listener; 53 | fDataGram = packet; 54 | 55 | listener.getMyExtasysUDPServer().getMyThreadPool().EnqueNetworkPacket(this); 56 | } 57 | 58 | @Override 59 | public void run() 60 | { 61 | try 62 | { 63 | // Wait for previous Packet to be processed 64 | // by the thread pool. 65 | super.WaitForPreviousPacketToBeProcessedAndCheckIfItWasCanceled(); 66 | 67 | // Call OnDataReceive 68 | if (!fCancel) 69 | { 70 | // Trim the incoming packet 71 | byte[] cleanData = Arrays.copyOfRange(fDataGram.getData(), 0, fDataGram.getLength()); 72 | 73 | // Revert incoming data 74 | cleanData = fMyListener.getConnectionDataConverter().Revert(cleanData); 75 | 76 | fDataGram.setData(cleanData, 0, cleanData.length); 77 | 78 | fMyListener.getMyExtasysUDPServer().OnDataReceive(fMyListener, fDataGram); 79 | } 80 | } 81 | catch (Exception ex) 82 | { 83 | } 84 | 85 | // Mark previous Packet as null. 86 | // GC will take it out later... 87 | fPreviousPacket = null; 88 | 89 | fDone.Set(); 90 | } 91 | 92 | } 93 | -------------------------------------------------------------------------------- /Extasys for Java/src/Extasys/Network/TCP/Client/Connectors/Packets/IncomingTCPClientPacket.java: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2008 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | package Extasys.Network.TCP.Client.Connectors.Packets; 21 | 22 | import Extasys.DataFrame; 23 | import Extasys.Network.TCP.Client.Connectors.TCPConnector; 24 | import Extasys.Network.NetworkPacket; 25 | import java.util.concurrent.RejectedExecutionException; 26 | 27 | /** 28 | * 29 | * @author Nikos Siatras 30 | */ 31 | public final class IncomingTCPClientPacket extends NetworkPacket 32 | { 33 | 34 | private final TCPConnector fConnector; 35 | 36 | /** 37 | * Constructs a new incoming packet received by a TCP connector. 38 | * 39 | * Use this class to receive data from a server. This is an incoming message 40 | * that will remain in the client's thread pool as a job for the thread pool 41 | * workers. 42 | * 43 | * @param connector is the TCP Connector where this message belongs to. 44 | * @param data 45 | * @param previousPacket is the previous incoming message of the TCP 46 | * Connector. 47 | */ 48 | public IncomingTCPClientPacket(TCPConnector connector, byte[] data, NetworkPacket previousPacket) 49 | { 50 | super(data, previousPacket); 51 | fConnector = connector; 52 | 53 | try 54 | { 55 | connector.getMyExtasysTCPClient().getMyThreadPool().EnqueNetworkPacket(this); 56 | } 57 | catch (RejectedExecutionException ex) 58 | { 59 | fConnector.ForceStop(); 60 | } 61 | } 62 | 63 | @Override 64 | public void run() 65 | { 66 | try 67 | { 68 | // Wait for previous Packet to be processed 69 | // by the thread pool. 70 | super.WaitForPreviousPacketToBeProcessedAndCheckIfItWasCanceled(); 71 | 72 | // Call OnDataReceive 73 | if (!fCancel) 74 | { 75 | // Revert Data using dataConverter 76 | final byte[] revertedData = fConnector.getConnectionDataConverter().Revert(fPacketsData); 77 | 78 | // Call OnDataReceive 79 | fConnector.getMyExtasysTCPClient().OnDataReceive(fConnector, new DataFrame(revertedData)); 80 | } 81 | } 82 | catch (Exception ex) 83 | { 84 | } 85 | 86 | // Mark previous Packet as null. 87 | // GC will take it out later... 88 | fPreviousPacket = null; 89 | 90 | fDone.Set(); 91 | } 92 | 93 | } 94 | -------------------------------------------------------------------------------- /Extasys for Java/src/Extasys/Network/TCP/Server/Listener/Packets/IncomingTCPClientConnectionPacket.java: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2008 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | package Extasys.Network.TCP.Server.Listener.Packets; 21 | 22 | import Extasys.DataFrame; 23 | import Extasys.Network.TCP.Server.Listener.TCPClientConnection; 24 | import Extasys.Network.NetworkPacket; 25 | import java.util.concurrent.RejectedExecutionException; 26 | 27 | /** 28 | * 29 | * @author Nikos Siatras 30 | */ 31 | public final class IncomingTCPClientConnectionPacket extends NetworkPacket 32 | { 33 | 34 | private final TCPClientConnection fClient; 35 | 36 | /** 37 | * Constructs a new incoming packet for an existing TCP client connection. 38 | * Use this class to receive data from a client. This is an incoming message 39 | * that will remain in the servers thread pool as a job for the thread pool 40 | * workers. 41 | * 42 | * @param client is the client where this message belongs to. 43 | * @param data 44 | * @param previousPacket is the previous incoming message of the client. 45 | */ 46 | public IncomingTCPClientConnectionPacket(TCPClientConnection client, byte[] data, NetworkPacket previousPacket) 47 | { 48 | super(data, previousPacket); 49 | fClient = client; 50 | 51 | try 52 | { 53 | client.getMyExtasysTCPServer().getMyThreadPool().EnqueNetworkPacket(this); 54 | } 55 | catch (RejectedExecutionException ex) 56 | { 57 | fClient.ForceDisconnect(); 58 | } 59 | 60 | } 61 | 62 | @Override 63 | public void run() 64 | { 65 | try 66 | { 67 | // Wait for previous Packet to be processed 68 | // by the thread pool. 69 | super.WaitForPreviousPacketToBeProcessedAndCheckIfItWasCanceled(); 70 | 71 | // Call on data receive 72 | if (!fCancel) 73 | { 74 | // Decrypt Data 75 | final byte[] decryptedData = fClient.getMyTCPListener().getConnectionDataConverter().Revert(fPacketsData); 76 | 77 | // Call OnDataReceive 78 | fClient.fMyExtasysServer.OnDataReceive(fClient, new DataFrame(decryptedData)); 79 | } 80 | } 81 | catch (Exception ex) 82 | { 83 | } 84 | 85 | // Mark previous Packet as null. 86 | // GC will take it out later... 87 | fPreviousPacket = null; 88 | 89 | fDone.Set(); 90 | } 91 | 92 | } 93 | -------------------------------------------------------------------------------- /Extasys for Java/src/Extasys/Network/UDP/Client/Connectors/Packets/OutgoingUDPClientPacket.java: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2008 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | package Extasys.Network.UDP.Client.Connectors.Packets; 21 | 22 | import Extasys.Network.UDP.Client.Connectors.UDPConnector; 23 | import Extasys.Network.NetworkPacket; 24 | import java.io.IOException; 25 | import java.net.DatagramPacket; 26 | 27 | /** 28 | * 29 | * @author Nikos Siatras 30 | */ 31 | public class OutgoingUDPClientPacket extends NetworkPacket 32 | { 33 | 34 | private final UDPConnector fConnector; 35 | private final DatagramPacket fDataGram; 36 | 37 | /** 38 | * Constructs a new outgoing packet for an existing UDP Connector. Use this 39 | * class to send data from the UDP Connector to a server. This is an 40 | * outgoing message that will remain in the clients thread pool as a job for 41 | * the thread pool workers. 42 | * 43 | * @param connector is the UDPConnector where this message belongs to. 44 | * @param data is the outgoing DatagramPacket. 45 | * @param previousPacket is the previous outgoing packet of the 46 | * UDPConnector. 47 | */ 48 | public OutgoingUDPClientPacket(UDPConnector connector, DatagramPacket data, NetworkPacket previousPacket) 49 | { 50 | super(data.getData(), previousPacket); 51 | fConnector = connector; 52 | fDataGram = data; 53 | 54 | connector.getMyExtasysUDPClient().getMyThreadPool().EnqueNetworkPacket(this); 55 | } 56 | 57 | @Override 58 | public void run() 59 | { 60 | try 61 | { 62 | // Wait for previous Packet to be processed 63 | // by the thread pool. 64 | super.WaitForPreviousPacketToBeProcessedAndCheckIfItWasCanceled(); 65 | 66 | // Convert outgoing data 67 | byte[] convertedData = fConnector.getConnectionDataConverter().Convert(fDataGram.getData()); 68 | fDataGram.setData(convertedData, 0, convertedData.length); 69 | 70 | if (!fCancel) 71 | { 72 | fConnector.fSocket.send(fDataGram); 73 | fConnector.fBytesOut += fDataGram.getLength(); 74 | fConnector.getMyExtasysUDPClient().fTotalBytesOut += fDataGram.getLength(); 75 | } 76 | } 77 | catch (IOException ex) 78 | { 79 | } 80 | 81 | // Mark previous Packet as null. 82 | // GC will take it out later... 83 | fPreviousPacket = null; 84 | 85 | fDone.Set(); 86 | } 87 | 88 | } 89 | -------------------------------------------------------------------------------- /Extasys for Java/src/Extasys/MessageCollector/MessageCollector.java: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2024 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | package Extasys.MessageCollector; 21 | 22 | import Extasys.ByteArrayBuilder; 23 | import Extasys.DataConvertion.DataConverter; 24 | 25 | /** 26 | * 27 | * @author Nikos Siatras 28 | */ 29 | public abstract class MessageCollector 30 | { 31 | 32 | private final ByteArrayBuilder fIncomingDataBuffer = new ByteArrayBuilder(); 33 | private final MessageETX fMessageETX; 34 | private int fIndexOf = -1; 35 | 36 | public MessageCollector(MessageETX messageETX) 37 | { 38 | fMessageETX = messageETX; 39 | } 40 | 41 | public synchronized void AppendDataWithConversion(final byte[] bytes, final DataConverter dataConverter) 42 | { 43 | try 44 | { 45 | fIncomingDataBuffer.Append(bytes); 46 | fIndexOf = fIncomingDataBuffer.IndexOf(fMessageETX.getBytes()); 47 | 48 | while (fIndexOf > -1) 49 | { 50 | MessageCollected(dataConverter.Revert(fIncomingDataBuffer.SubList(0, fIndexOf))); 51 | fIncomingDataBuffer.Delete(0, fIndexOf + fMessageETX.getLength()); 52 | fIndexOf = fIncomingDataBuffer.IndexOf(fMessageETX.getBytes()); 53 | } 54 | } 55 | catch (Exception ex) 56 | { 57 | //System.err.println("Extasys.Network.TCP.Client.Connectors.Tools.TCPClientMessageCollector Error: " + ex.getMessage()); 58 | } 59 | } 60 | 61 | public synchronized void AppendData(final byte[] bytes) 62 | { 63 | try 64 | { 65 | fIncomingDataBuffer.Append(bytes); 66 | fIndexOf = fIncomingDataBuffer.IndexOf(fMessageETX.getBytes()); 67 | 68 | while (fIndexOf > -1) 69 | { 70 | MessageCollected(fIncomingDataBuffer.SubList(0, fIndexOf)); 71 | fIncomingDataBuffer.Delete(0, fIndexOf + fMessageETX.getLength()); 72 | fIndexOf = fIncomingDataBuffer.IndexOf(fMessageETX.getBytes()); 73 | } 74 | } 75 | catch (Exception ex) 76 | { 77 | //System.err.println("Extasys.Network.TCP.Client.Connectors.Tools.TCPClientMessageCollector Error: " + ex.getMessage()); 78 | } 79 | } 80 | 81 | /** 82 | * This method is called every time the message collector collects a message 83 | * 84 | * @param bytes 85 | */ 86 | public abstract void MessageCollected(final byte[] bytes); 87 | 88 | public void Dispose() 89 | { 90 | // Do nothing.. 91 | } 92 | 93 | } 94 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys/Network/TCP/Server/Listener/TCPListenerThread.cs: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2008 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | using System; 21 | using System.Collections.Generic; 22 | using System.Linq; 23 | using System.Text; 24 | using System.Threading; 25 | using System.Net.Sockets; 26 | 27 | namespace Extasys.Network.TCP.Server.Listener 28 | { 29 | public class TCPListenerThread 30 | { 31 | private Thread fListenThread; 32 | private TcpListener fSocket; 33 | private TCPListener fMyListener; 34 | private bool fThreadIsRunning = false; 35 | 36 | private ManualResetEvent fClientConnectionCompleted = new ManualResetEvent(false); 37 | 38 | public TCPListenerThread(TcpListener socket, TCPListener myListener) 39 | { 40 | fSocket = socket; 41 | fMyListener = myListener; 42 | } 43 | 44 | public void Start() 45 | { 46 | fThreadIsRunning = true; 47 | fListenThread = new Thread(new ThreadStart(DoListen)); 48 | fListenThread.Start(); 49 | } 50 | 51 | private void DoListen() 52 | { 53 | fClientConnectionCompleted.Reset(); 54 | try 55 | { 56 | fSocket.BeginAcceptSocket(new AsyncCallback(DoAcceptSocketCallback), fSocket); 57 | fClientConnectionCompleted.WaitOne(); 58 | } 59 | catch (Exception ex) 60 | { 61 | fClientConnectionCompleted.Set(); 62 | } 63 | } 64 | 65 | 66 | private void DoAcceptSocketCallback(IAsyncResult ar) 67 | { 68 | if (fThreadIsRunning) 69 | { 70 | try 71 | { 72 | TcpListener listener = (TcpListener)ar.AsyncState; 73 | 74 | TCPClientConnection client = new TCPClientConnection(listener.EndAcceptSocket(ar), fMyListener, fMyListener.IsMessageCollectorInUse, fMyListener.MessageSplitter); 75 | fClientConnectionCompleted.Set(); 76 | 77 | if (fMyListener.ConnectedClients.Count >= fMyListener.MaxConnections) 78 | { 79 | client.DisconnectMe(); 80 | } 81 | } 82 | catch (Exception ex) 83 | { 84 | } 85 | 86 | DoListen(); 87 | } 88 | } 89 | 90 | public void Stop() 91 | { 92 | fThreadIsRunning = false; 93 | fClientConnectionCompleted.Set(); 94 | } 95 | 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /Extasys for Java/src/Extasys/Network/Abstract/AbstractServer.java: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2024 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | package Extasys.Network.Abstract; 21 | 22 | import Extasys.ExtasysThreadPool; 23 | 24 | /** 25 | * 26 | * @author Nikos Siatras - https://github.com/nsiatras 27 | * 28 | * This class holds common properties for Listeners such as the TCPServer and 29 | * the UDPServer 30 | */ 31 | public abstract class AbstractServer 32 | { 33 | 34 | private String fName, fDescription; 35 | protected final ExtasysThreadPool fMyThreadPool; 36 | public long fTotalBytesIn = 0, fTotalBytesOut = 0; 37 | 38 | public AbstractServer(String name, String description, int corePoolSize, int maximumPoolSize) 39 | { 40 | fName = name; 41 | fDescription = description; 42 | fMyThreadPool = new ExtasysThreadPool(corePoolSize, maximumPoolSize); 43 | } 44 | 45 | public abstract void Dispose(); 46 | 47 | /** 48 | * Server's name. 49 | * 50 | * @return server's name. 51 | */ 52 | public String getName() 53 | { 54 | return fName; 55 | } 56 | 57 | /** 58 | * Set's the server's name 59 | * 60 | * @param name 61 | */ 62 | public void setName(String name) 63 | { 64 | fName = name; 65 | } 66 | 67 | /** 68 | * Server's description. 69 | * 70 | * @return server's description. 71 | */ 72 | public String getDescription() 73 | { 74 | return fDescription; 75 | } 76 | 77 | /** 78 | * Set's the server's description 79 | * 80 | * @param description is the server's description 81 | */ 82 | public void setDescription(String description) 83 | { 84 | fDescription = description; 85 | } 86 | 87 | /** 88 | * Returns the server's ThreadPool. 89 | * 90 | * @return My Thread Pool. 91 | */ 92 | public ExtasysThreadPool getMyThreadPool() 93 | { 94 | return fMyThreadPool; 95 | } 96 | 97 | /** 98 | * Returns the total bytes received from this server. 99 | * 100 | * @return the total bytes received from this server. 101 | */ 102 | public long getBytesIn() 103 | { 104 | return fTotalBytesIn; 105 | } 106 | 107 | /** 108 | * Returns the total bytes sent from this server. 109 | * 110 | * @return the total bytes sent from this server. 111 | */ 112 | public long getBytesOut() 113 | { 114 | return fTotalBytesOut; 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.TCPClient/nbproject/project.properties: -------------------------------------------------------------------------------- 1 | annotation.processing.enabled=true 2 | annotation.processing.enabled.in.editor=false 3 | annotation.processing.processors.list= 4 | annotation.processing.run.all.processors=true 5 | annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output 6 | application.title=Extasys.Examples.TCPClient 7 | application.vendor=nsiat 8 | build.classes.dir=${build.dir}/classes 9 | build.classes.excludes=**/*.java,**/*.form 10 | # This directory is removed when the project is cleaned: 11 | build.dir=build 12 | build.generated.dir=${build.dir}/generated 13 | build.generated.sources.dir=${build.dir}/generated-sources 14 | # Only compile against the classpath explicitly listed here: 15 | build.sysclasspath=ignore 16 | build.test.classes.dir=${build.dir}/test/classes 17 | build.test.results.dir=${build.dir}/test/results 18 | # Uncomment to specify the preferred debugger connection transport: 19 | #debug.transport=dt_socket 20 | debug.classpath=\ 21 | ${run.classpath} 22 | debug.modulepath=\ 23 | ${run.modulepath} 24 | debug.test.classpath=\ 25 | ${run.test.classpath} 26 | debug.test.modulepath=\ 27 | ${run.test.modulepath} 28 | # Files in build.classes.dir which should be excluded from distribution jar 29 | dist.archive.excludes= 30 | # This directory is removed when the project is cleaned: 31 | dist.dir=dist 32 | dist.jar=${dist.dir}/Extasys.Examples.TCPClient.jar 33 | dist.javadoc.dir=${dist.dir}/javadoc 34 | dist.jlink.dir=${dist.dir}/jlink 35 | dist.jlink.output=${dist.jlink.dir}/Extasys.Examples.TCPClient 36 | endorsed.classpath= 37 | excludes= 38 | includes=** 39 | jar.compress=false 40 | javac.classpath=\ 41 | ${reference.Extasys.jar} 42 | # Space-separated list of extra javac options 43 | javac.compilerargs= 44 | javac.deprecation=false 45 | javac.external.vm=true 46 | javac.modulepath= 47 | javac.processormodulepath= 48 | javac.processorpath=\ 49 | ${javac.classpath} 50 | javac.source=1.8 51 | javac.target=1.8 52 | javac.test.classpath=\ 53 | ${javac.classpath}:\ 54 | ${build.classes.dir} 55 | javac.test.modulepath=\ 56 | ${javac.modulepath} 57 | javac.test.processorpath=\ 58 | ${javac.test.classpath} 59 | javadoc.additionalparam= 60 | javadoc.author=false 61 | javadoc.encoding=${source.encoding} 62 | javadoc.html5=false 63 | javadoc.noindex=false 64 | javadoc.nonavbar=false 65 | javadoc.notree=false 66 | javadoc.private=false 67 | javadoc.splitindex=true 68 | javadoc.use=true 69 | javadoc.version=false 70 | javadoc.windowtitle= 71 | # The jlink additional root modules to resolve 72 | jlink.additionalmodules= 73 | # The jlink additional command line parameters 74 | jlink.additionalparam= 75 | jlink.launcher=true 76 | jlink.launcher.name=Extasys.Examples.TCPClient 77 | main.class=Extasys.Examples.TCPClient.frmMain 78 | manifest.file=manifest.mf 79 | meta.inf.dir=${src.dir}/META-INF 80 | mkdist.disabled=false 81 | platform.active=default_platform 82 | project.Extasys=../../Extasys for Java 83 | reference.Extasys.jar=${project.Extasys}/dist/Extasys.jar 84 | run.classpath=\ 85 | ${javac.classpath}:\ 86 | ${build.classes.dir} 87 | # Space-separated list of JVM arguments used when running the project. 88 | # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. 89 | # To set system properties for unit tests define test-sys-prop.name=value: 90 | run.jvmargs= 91 | run.modulepath=\ 92 | ${javac.modulepath} 93 | run.test.classpath=\ 94 | ${javac.test.classpath}:\ 95 | ${build.test.classes.dir} 96 | run.test.modulepath=\ 97 | ${javac.test.modulepath} 98 | source.encoding=UTF-8 99 | src.dir=src 100 | test.src.dir=test 101 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.TCPServer/nbproject/project.properties: -------------------------------------------------------------------------------- 1 | annotation.processing.enabled=true 2 | annotation.processing.enabled.in.editor=false 3 | annotation.processing.processors.list= 4 | annotation.processing.run.all.processors=true 5 | annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output 6 | application.title=Extasys.Examples.TCPServer 7 | application.vendor=nsiat 8 | build.classes.dir=${build.dir}/classes 9 | build.classes.excludes=**/*.java,**/*.form 10 | # This directory is removed when the project is cleaned: 11 | build.dir=build 12 | build.generated.dir=${build.dir}/generated 13 | build.generated.sources.dir=${build.dir}/generated-sources 14 | # Only compile against the classpath explicitly listed here: 15 | build.sysclasspath=ignore 16 | build.test.classes.dir=${build.dir}/test/classes 17 | build.test.results.dir=${build.dir}/test/results 18 | # Uncomment to specify the preferred debugger connection transport: 19 | #debug.transport=dt_socket 20 | debug.classpath=\ 21 | ${run.classpath} 22 | debug.modulepath=\ 23 | ${run.modulepath} 24 | debug.test.classpath=\ 25 | ${run.test.classpath} 26 | debug.test.modulepath=\ 27 | ${run.test.modulepath} 28 | # Files in build.classes.dir which should be excluded from distribution jar 29 | dist.archive.excludes= 30 | # This directory is removed when the project is cleaned: 31 | dist.dir=dist 32 | dist.jar=${dist.dir}/Extasys.Examples.TCPServer.jar 33 | dist.javadoc.dir=${dist.dir}/javadoc 34 | dist.jlink.dir=${dist.dir}/jlink 35 | dist.jlink.output=${dist.jlink.dir}/Extasys.Examples.TCPServer 36 | endorsed.classpath= 37 | excludes= 38 | includes=** 39 | jar.compress=false 40 | javac.classpath=\ 41 | ${reference.Extasys.jar} 42 | # Space-separated list of extra javac options 43 | javac.compilerargs= 44 | javac.deprecation=false 45 | javac.external.vm=true 46 | javac.modulepath= 47 | javac.processormodulepath= 48 | javac.processorpath=\ 49 | ${javac.classpath} 50 | javac.source=1.8 51 | javac.target=1.8 52 | javac.test.classpath=\ 53 | ${javac.classpath}:\ 54 | ${build.classes.dir} 55 | javac.test.modulepath=\ 56 | ${javac.modulepath} 57 | javac.test.processorpath=\ 58 | ${javac.test.classpath} 59 | javadoc.additionalparam= 60 | javadoc.author=false 61 | javadoc.encoding=${source.encoding} 62 | javadoc.html5=false 63 | javadoc.noindex=false 64 | javadoc.nonavbar=false 65 | javadoc.notree=false 66 | javadoc.private=false 67 | javadoc.splitindex=true 68 | javadoc.use=true 69 | javadoc.version=false 70 | javadoc.windowtitle= 71 | # The jlink additional root modules to resolve 72 | jlink.additionalmodules= 73 | # The jlink additional command line parameters 74 | jlink.additionalparam= 75 | jlink.launcher=true 76 | jlink.launcher.name=Extasys.Examples.TCPServer 77 | main.class=Extasys.Examples.TCPServer.frmTCPServer 78 | manifest.file=manifest.mf 79 | meta.inf.dir=${src.dir}/META-INF 80 | mkdist.disabled=false 81 | platform.active=default_platform 82 | project.Extasys=../../Extasys for Java 83 | reference.Extasys.jar=${project.Extasys}/dist/Extasys.jar 84 | run.classpath=\ 85 | ${javac.classpath}:\ 86 | ${build.classes.dir} 87 | # Space-separated list of JVM arguments used when running the project. 88 | # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. 89 | # To set system properties for unit tests define test-sys-prop.name=value: 90 | run.jvmargs= 91 | run.modulepath=\ 92 | ${javac.modulepath} 93 | run.test.classpath=\ 94 | ${javac.test.classpath}:\ 95 | ${build.test.classes.dir} 96 | run.test.modulepath=\ 97 | ${javac.test.modulepath} 98 | source.encoding=UTF-8 99 | src.dir=src 100 | test.src.dir=test 101 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.UDPClient/nbproject/project.properties: -------------------------------------------------------------------------------- 1 | annotation.processing.enabled=true 2 | annotation.processing.enabled.in.editor=false 3 | annotation.processing.processors.list= 4 | annotation.processing.run.all.processors=true 5 | annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output 6 | application.title=Extasys.Examples.UDPClient 7 | application.vendor=nsiat 8 | build.classes.dir=${build.dir}/classes 9 | build.classes.excludes=**/*.java,**/*.form 10 | # This directory is removed when the project is cleaned: 11 | build.dir=build 12 | build.generated.dir=${build.dir}/generated 13 | build.generated.sources.dir=${build.dir}/generated-sources 14 | # Only compile against the classpath explicitly listed here: 15 | build.sysclasspath=ignore 16 | build.test.classes.dir=${build.dir}/test/classes 17 | build.test.results.dir=${build.dir}/test/results 18 | # Uncomment to specify the preferred debugger connection transport: 19 | #debug.transport=dt_socket 20 | debug.classpath=\ 21 | ${run.classpath} 22 | debug.modulepath=\ 23 | ${run.modulepath} 24 | debug.test.classpath=\ 25 | ${run.test.classpath} 26 | debug.test.modulepath=\ 27 | ${run.test.modulepath} 28 | # Files in build.classes.dir which should be excluded from distribution jar 29 | dist.archive.excludes= 30 | # This directory is removed when the project is cleaned: 31 | dist.dir=dist 32 | dist.jar=${dist.dir}/Extasys.Examples.UDPClient.jar 33 | dist.javadoc.dir=${dist.dir}/javadoc 34 | dist.jlink.dir=${dist.dir}/jlink 35 | dist.jlink.output=${dist.jlink.dir}/Extasys.Examples.UDPClient 36 | endorsed.classpath= 37 | excludes= 38 | includes=** 39 | jar.compress=false 40 | javac.classpath=\ 41 | ${reference.Extasys.jar} 42 | # Space-separated list of extra javac options 43 | javac.compilerargs= 44 | javac.deprecation=false 45 | javac.external.vm=true 46 | javac.modulepath= 47 | javac.processormodulepath= 48 | javac.processorpath=\ 49 | ${javac.classpath} 50 | javac.source=1.8 51 | javac.target=1.8 52 | javac.test.classpath=\ 53 | ${javac.classpath}:\ 54 | ${build.classes.dir} 55 | javac.test.modulepath=\ 56 | ${javac.modulepath} 57 | javac.test.processorpath=\ 58 | ${javac.test.classpath} 59 | javadoc.additionalparam= 60 | javadoc.author=false 61 | javadoc.encoding=${source.encoding} 62 | javadoc.html5=false 63 | javadoc.noindex=false 64 | javadoc.nonavbar=false 65 | javadoc.notree=false 66 | javadoc.private=false 67 | javadoc.splitindex=true 68 | javadoc.use=true 69 | javadoc.version=false 70 | javadoc.windowtitle= 71 | # The jlink additional root modules to resolve 72 | jlink.additionalmodules= 73 | # The jlink additional command line parameters 74 | jlink.additionalparam= 75 | jlink.launcher=true 76 | jlink.launcher.name=Extasys.Examples.UDPClient 77 | main.class=Extasys.Examples.UDPClient.frmUDPClient 78 | manifest.file=manifest.mf 79 | meta.inf.dir=${src.dir}/META-INF 80 | mkdist.disabled=false 81 | platform.active=default_platform 82 | project.Extasys=../../Extasys for Java 83 | reference.Extasys.jar=${project.Extasys}/dist/Extasys.jar 84 | run.classpath=\ 85 | ${javac.classpath}:\ 86 | ${build.classes.dir} 87 | # Space-separated list of JVM arguments used when running the project. 88 | # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. 89 | # To set system properties for unit tests define test-sys-prop.name=value: 90 | run.jvmargs= 91 | run.modulepath=\ 92 | ${javac.modulepath} 93 | run.test.classpath=\ 94 | ${javac.test.classpath}:\ 95 | ${build.test.classes.dir} 96 | run.test.modulepath=\ 97 | ${javac.test.modulepath} 98 | source.encoding=UTF-8 99 | src.dir=src 100 | test.src.dir=test 101 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.UDPServer/nbproject/project.properties: -------------------------------------------------------------------------------- 1 | annotation.processing.enabled=true 2 | annotation.processing.enabled.in.editor=false 3 | annotation.processing.processors.list= 4 | annotation.processing.run.all.processors=true 5 | annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output 6 | application.title=Extasys.Examples.UDPServer 7 | application.vendor=nsiat 8 | build.classes.dir=${build.dir}/classes 9 | build.classes.excludes=**/*.java,**/*.form 10 | # This directory is removed when the project is cleaned: 11 | build.dir=build 12 | build.generated.dir=${build.dir}/generated 13 | build.generated.sources.dir=${build.dir}/generated-sources 14 | # Only compile against the classpath explicitly listed here: 15 | build.sysclasspath=ignore 16 | build.test.classes.dir=${build.dir}/test/classes 17 | build.test.results.dir=${build.dir}/test/results 18 | # Uncomment to specify the preferred debugger connection transport: 19 | #debug.transport=dt_socket 20 | debug.classpath=\ 21 | ${run.classpath} 22 | debug.modulepath=\ 23 | ${run.modulepath} 24 | debug.test.classpath=\ 25 | ${run.test.classpath} 26 | debug.test.modulepath=\ 27 | ${run.test.modulepath} 28 | # Files in build.classes.dir which should be excluded from distribution jar 29 | dist.archive.excludes= 30 | # This directory is removed when the project is cleaned: 31 | dist.dir=dist 32 | dist.jar=${dist.dir}/Extasys.Examples.UDPServer.jar 33 | dist.javadoc.dir=${dist.dir}/javadoc 34 | dist.jlink.dir=${dist.dir}/jlink 35 | dist.jlink.output=${dist.jlink.dir}/Extasys.Examples.UDPServer 36 | endorsed.classpath= 37 | excludes= 38 | includes=** 39 | jar.compress=false 40 | javac.classpath=\ 41 | ${reference.Extasys.jar} 42 | # Space-separated list of extra javac options 43 | javac.compilerargs= 44 | javac.deprecation=false 45 | javac.external.vm=true 46 | javac.modulepath= 47 | javac.processormodulepath= 48 | javac.processorpath=\ 49 | ${javac.classpath} 50 | javac.source=1.8 51 | javac.target=1.8 52 | javac.test.classpath=\ 53 | ${javac.classpath}:\ 54 | ${build.classes.dir} 55 | javac.test.modulepath=\ 56 | ${javac.modulepath} 57 | javac.test.processorpath=\ 58 | ${javac.test.classpath} 59 | javadoc.additionalparam= 60 | javadoc.author=false 61 | javadoc.encoding=${source.encoding} 62 | javadoc.html5=false 63 | javadoc.noindex=false 64 | javadoc.nonavbar=false 65 | javadoc.notree=false 66 | javadoc.private=false 67 | javadoc.splitindex=true 68 | javadoc.use=true 69 | javadoc.version=false 70 | javadoc.windowtitle= 71 | # The jlink additional root modules to resolve 72 | jlink.additionalmodules= 73 | # The jlink additional command line parameters 74 | jlink.additionalparam= 75 | jlink.launcher=true 76 | jlink.launcher.name=Extasys.Examples.UDPServer 77 | main.class=Extasys.Examples.UDPServer.frmUDPServer 78 | manifest.file=manifest.mf 79 | meta.inf.dir=${src.dir}/META-INF 80 | mkdist.disabled=false 81 | platform.active=default_platform 82 | project.Extasys=../../Extasys for Java 83 | reference.Extasys.jar=${project.Extasys}/dist/Extasys.jar 84 | run.classpath=\ 85 | ${javac.classpath}:\ 86 | ${build.classes.dir} 87 | # Space-separated list of JVM arguments used when running the project. 88 | # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. 89 | # To set system properties for unit tests define test-sys-prop.name=value: 90 | run.jvmargs= 91 | run.modulepath=\ 92 | ${javac.modulepath} 93 | run.test.classpath=\ 94 | ${javac.test.classpath}:\ 95 | ${build.test.classes.dir} 96 | run.test.modulepath=\ 97 | ${javac.test.modulepath} 98 | source.encoding=UTF-8 99 | src.dir=src 100 | test.src.dir=test 101 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.TCPServer/src/Extasys/Examples/TCPServer/TCPServer.java: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2008 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | package Extasys.Examples.TCPServer; 21 | 22 | import Extasys.DataFrame; 23 | import Extasys.DataConvertion.Base64Converter; 24 | import Extasys.Network.TCP.Server.Listener.Exceptions.ClientIsDisconnectedException; 25 | import Extasys.Network.TCP.Server.Listener.Exceptions.OutgoingPacketFailedException; 26 | import Extasys.Network.TCP.Server.Listener.TCPClientConnection; 27 | import Extasys.Network.TCP.Server.Listener.TCPListener; 28 | import java.net.InetAddress; 29 | 30 | /** 31 | * 32 | * @author Nikos Siatras 33 | */ 34 | public class TCPServer extends Extasys.Network.TCP.Server.ExtasysTCPServer 35 | { 36 | 37 | public TCPServer(String name, String description, InetAddress listenerIP, int port, int maxConnections, int connectionsTimeOut, int corePoolSize, int maximumPoolSize) 38 | { 39 | super(name, description, corePoolSize, maximumPoolSize); 40 | 41 | try 42 | { 43 | // Add a new TCPListener to the server 44 | TCPListener listener = super.AddListener("My listener", listenerIP, port, maxConnections, 8192, connectionsTimeOut, 100, (char) 3); 45 | listener.setAutoApplyMessageSplitterState(true); // Auto apply message splitter to outgoing messages 46 | listener.setConnectionDataConverter(new Base64Converter()); // Base 64 Encoding 47 | } 48 | catch (Exception ex) 49 | { 50 | } 51 | } 52 | 53 | @Override 54 | public void OnDataReceive(TCPClientConnection sender, DataFrame data) 55 | { 56 | try 57 | { 58 | // I received data from a client 59 | final String incomingDataStr = new String(data.getBytes()); 60 | 61 | // Send the incoming data back to the sender 62 | sender.SendData(incomingDataStr); 63 | } 64 | catch (ClientIsDisconnectedException | OutgoingPacketFailedException ex) 65 | { 66 | 67 | } 68 | } 69 | 70 | @Override 71 | public void OnClientConnect(TCPClientConnection client) 72 | { 73 | // New client connected. 74 | client.setName(client.getIPAddress()); // Set a name for this client if you want to. 75 | System.out.println(client.getIPAddress() + " connected."); 76 | System.out.println("Total clients connected: " + super.getCurrentConnectionsNumber()); 77 | } 78 | 79 | @Override 80 | public void OnClientDisconnect(TCPClientConnection client) 81 | { 82 | // Client disconnected. 83 | System.out.println(client.getIPAddress() + " disconnected."); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /Extasys for Java/src/Extasys/Network/Abstract/AbstractClient.java: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2024 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | package Extasys.Network.Abstract; 21 | 22 | import Extasys.ExtasysThreadPool; 23 | 24 | /** 25 | * 26 | * @author Nikos Siatras - https://github.com/nsiatras 27 | * 28 | * This class holds common properties for Clients such as the TCPClient and the 29 | * UDPClient 30 | */ 31 | public abstract class AbstractClient 32 | { 33 | 34 | private String fName, fDescription; 35 | protected final ExtasysThreadPool fMyThreadPool; 36 | public long fTotalBytesIn = 0, fTotalBytesOut = 0; 37 | 38 | public AbstractClient(String name, String description, int corePoolSize, int maximumPoolSize) 39 | { 40 | fName = name; 41 | fDescription = description; 42 | fMyThreadPool = new ExtasysThreadPool(corePoolSize, maximumPoolSize); 43 | } 44 | 45 | public abstract void Dispose(); 46 | 47 | /** 48 | * Return the name of the client. 49 | * 50 | * @return the name of the client. 51 | */ 52 | public String getName() 53 | { 54 | return fName; 55 | } 56 | 57 | /** 58 | * Sets the name of the TCPClient 59 | * 60 | * @param name 61 | */ 62 | public void setName(String name) 63 | { 64 | fName = name; 65 | } 66 | 67 | /** 68 | * Return the description of the client. 69 | * 70 | * @return the description of the client. 71 | */ 72 | public String getDescription() 73 | { 74 | return fDescription; 75 | } 76 | 77 | /** 78 | * Sets the description of the TCPClient 79 | * 80 | * @param description is the TCPClient's description 81 | */ 82 | public void setDescription(String description) 83 | { 84 | fDescription = description; 85 | } 86 | 87 | /** 88 | * Return the client's Thread Pool. 89 | * 90 | * @return the client's Thread Pool. 91 | */ 92 | public ExtasysThreadPool getMyThreadPool() 93 | { 94 | return fMyThreadPool; 95 | } 96 | 97 | /** 98 | * Returns the total number of bytes received by this client. 99 | * 100 | * @return the number of bytes received by this client. 101 | */ 102 | public long getBytesIn() 103 | { 104 | return fTotalBytesIn; 105 | } 106 | 107 | /** 108 | * Returns the total number of bytes send from this client. 109 | * 110 | * @return the total number of bytes send from this client. 111 | */ 112 | public long getBytesOut() 113 | { 114 | return fTotalBytesOut; 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /Deprecated/Extasys for .NET/Extasys/Network/TCP/Client/Connectors/Packets/MessageCollectorTCPClientPacket.cs: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2008 Nikos Siatras 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE.*/ 20 | using System; 21 | using System.Collections.Generic; 22 | using System.Linq; 23 | using System.Text; 24 | using System.Threading; 25 | 26 | namespace Extasys.Network.TCP.Client.Connectors.Packets 27 | { 28 | public class MessageCollectorTCPClientPacket 29 | { 30 | public ManualResetEvent fDone = new ManualResetEvent(false); 31 | private TCPConnector fConnector; 32 | private String fData; 33 | private MessageCollectorTCPClientPacket fPreviousPacket; 34 | public bool fCancel = false; 35 | 36 | public MessageCollectorTCPClientPacket(TCPConnector connector, String data, MessageCollectorTCPClientPacket previousPacket) 37 | { 38 | fConnector = connector; 39 | fData = data; 40 | fPreviousPacket = previousPacket; 41 | 42 | ThreadPool.QueueUserWorkItem(new WaitCallback(ReadData)); 43 | } 44 | 45 | private void ReadData(object stateObject) 46 | { 47 | try 48 | { 49 | if (fPreviousPacket == null) 50 | { 51 | fConnector.fMessageCollector.AppendData(fData); 52 | } 53 | else 54 | { 55 | fPreviousPacket.fDone.WaitOne(); 56 | if (!fCancel && !fPreviousPacket.fCancel) 57 | { 58 | fConnector.fMessageCollector.AppendData(fData); 59 | } 60 | else 61 | { 62 | fCancel = true; 63 | } 64 | 65 | fPreviousPacket = null; 66 | } 67 | } 68 | catch (Exception ex) 69 | { 70 | } 71 | 72 | fDone.Set(); 73 | } 74 | 75 | /// 76 | /// Cancel this message collector packet. 77 | /// 78 | /// By calling this method this and all the previous message collector packets that 79 | /// are stored in the thread pool will be canceled. 80 | /// Call this method for the last message collector packet of the connector 81 | /// when the connector disconnects. 82 | /// 83 | public void Cancel() 84 | { 85 | fCancel = true; 86 | fDone.Set(); 87 | } 88 | 89 | /// 90 | /// Returns the data of this packet. 91 | /// 92 | public string Data 93 | { 94 | get { return fData; } 95 | } 96 | 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.TCPClient/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Builds, tests, and runs the project Extasys.Examples.TCPClient. 12 | 13 | 73 | 74 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.TCPServer/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Builds, tests, and runs the project Extasys.Examples.TCPServer. 12 | 13 | 73 | 74 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.UDPClient/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Builds, tests, and runs the project Extasys.Examples.UDPClient. 12 | 13 | 73 | 74 | -------------------------------------------------------------------------------- /Extasys for Java Examples/Extasys.Examples.UDPServer/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Builds, tests, and runs the project Extasys.Examples.UDPServer. 12 | 13 | 73 | 74 | --------------------------------------------------------------------------------