clean TCPIP library test
authorcharlie <charlie.gerhardus@student.ru.nl>
Sat, 19 Dec 2015 16:05:11 +0000 (17:05 +0100)
committercharlie <charlie.gerhardus@student.ru.nl>
Sat, 19 Dec 2015 16:05:11 +0000 (17:05 +0100)
.gitignore
a3/code/clean-tcptest/Program.cs [new file with mode: 0644]
a3/code/clean-tcptest/tcpiptest.icl [new file with mode: 0644]
a3/code/clean-tcptest/tcpiptest.prj [new file with mode: 0644]

index b828972..fd12962 100644 (file)
@@ -41,3 +41,4 @@ C:\\nppdf32Log\\debuglog.txt
 *.pyc
 [0-9][0-9].py
 sn.txt
+*.exe
diff --git a/a3/code/clean-tcptest/Program.cs b/a3/code/clean-tcptest/Program.cs
new file mode 100644 (file)
index 0000000..7b20423
--- /dev/null
@@ -0,0 +1,41 @@
+using System;\r
+using System.Collections.Generic;\r
+using System.IO;\r
+using System.Linq;\r
+using System.Net.Sockets;\r
+using System.Text;\r
+using System.Threading.Tasks;\r
+\r
+namespace TcpTest\r
+{\r
+    class Program\r
+    {\r
+        static void Main(string[] args)\r
+        {\r
+            TcpListener tcp = new TcpListener(1203);\r
+            tcp.ExclusiveAddressUse = false;\r
+            tcp.Start();\r
+\r
+            while (true)\r
+            {\r
+                TcpClient client = tcp.AcceptTcpClient();\r
+                if (client == null)\r
+                {\r
+                    continue;\r
+                }\r
+\r
+                Console.WriteLine("client connected...");\r
+                Stream stream = client.GetStream();\r
+\r
+                int ch = 0;\r
+                while ((ch=stream.ReadByte()) != -1)\r
+                {\r
+                    Console.Write((char)ch);\r
+                }\r
+\r
+                client.Close();\r
+                client = null;\r
+            }\r
+        }\r
+    }\r
+}\r
diff --git a/a3/code/clean-tcptest/tcpiptest.icl b/a3/code/clean-tcptest/tcpiptest.icl
new file mode 100644 (file)
index 0000000..2f88587
--- /dev/null
@@ -0,0 +1,20 @@
+module tcpiptest\r
+\r
+import StdEnv\r
+import StdMaybe\r
+import TCPIP\r
+\r
+hostIP = "127.0.0.1"\r
+hostPort = 1203\r
+\r
+handleComs con world = (con``, world``) where\r
+       (con`, world`) = send "Hello World!\n" con world\r
+       (con``, world``) = send "More text here!\n" con` world`\r
+\r
+Start world = case to of\r
+       TR_Success = handleComs (toStringSChannel con.sChannel) world``\r
+       _ = abort "CONNECTION ERROR" \r
+where\r
+               (Just adr, world`) = lookupIPAddress hostIP world\r
+               (to, mcon, world``) = connectTCP_MT Nothing (adr,hostPort) world`\r
+               (Just con) = mcon\r
diff --git a/a3/code/clean-tcptest/tcpiptest.prj b/a3/code/clean-tcptest/tcpiptest.prj
new file mode 100644 (file)
index 0000000..923432a
--- /dev/null
@@ -0,0 +1,482 @@
+Version: 1.4\r
+Global\r
+       ProjectRoot:    .\r
+       Target: StdEnv\r
+       Exec:   {Project}\tcpiptest.exe\r
+       CodeGen\r
+               CheckStacks:    False\r
+               CheckIndexes:   True\r
+       Application\r
+               HeapSize:       2097152\r
+               StackSize:      512000\r
+               ExtraMemory:    81920\r
+               IntialHeapSize: 204800\r
+               HeapSizeMultiplier:     4096\r
+               ShowExecutionTime:      False\r
+               ShowGC: False\r
+               ShowStackSize:  False\r
+               MarkingCollector:       False\r
+               StandardRuntimeEnv:     True\r
+               Profile\r
+                       Memory: False\r
+                       MemoryMinimumHeapSize:  0\r
+                       Time:   False\r
+                       Stack:  False\r
+               Output\r
+                       Output: ShowConstructors\r
+                       Font:   Courier\r
+                       FontSize:       9\r
+                       WriteStdErr:    False\r
+       Link\r
+               LinkMethod:     Static\r
+               GenerateRelocations:    False\r
+               GenerateLinkMap:        False\r
+               LinkResources:  False\r
+               ResourceSource: \r
+               GenerateDLL:    False\r
+               ExportedNames:  \r
+       Paths\r
+               Path:   {Project}\r
+               Path:   {Application}\Libraries\TCPIP\r
+               Path:   {Application}\Libraries\StdLib\r
+       Precompile:     \r
+       Postlink:       \r
+MainModule\r
+       Name:   tcpiptest\r
+       Dir:    {Project}\r
+       Compiler\r
+               NeverMemoryProfile:     False\r
+               NeverTimeProfile:       False\r
+               StrictnessAnalysis:     True\r
+               ListTypes:      StrictExportTypes\r
+               ListAttributes: True\r
+               Warnings:       True\r
+               Verbose:        True\r
+               ReadableABC:    False\r
+               ReuseUniqueNodes:       True\r
+               Fusion: False\r
+OtherModules\r
+       Module\r
+               Name:   TCPChannelClass\r
+               Dir:    {Application}\Libraries\TCPIP\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   TCPChannels\r
+               Dir:    {Application}\Libraries\TCPIP\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   TCPDef\r
+               Dir:    {Application}\Libraries\TCPIP\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   TCPEvent\r
+               Dir:    {Application}\Libraries\TCPIP\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   TCPIP\r
+               Dir:    {Application}\Libraries\TCPIP\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   TCPStringChannels\r
+               Dir:    {Application}\Libraries\TCPIP\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   TCPStringChannelsInternal\r
+               Dir:    {Application}\Libraries\TCPIP\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   ostcp\r
+               Dir:    {Application}\Libraries\TCPIP\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+               NeededObjFiles\r
+                       ObjectFile:     cTCP_121.\r
+               NeededLibraries\r
+                       Library:        wsock_library\r
+       Module\r
+               Name:   tcp\r
+               Dir:    {Application}\Libraries\TCPIP\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   tcp_bytestreams\r
+               Dir:    {Application}\Libraries\TCPIP\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdMaybe\r
+               Dir:    {Application}\Libraries\StdLib\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdArray\r
+               Dir:    {Application}\Libraries\StdEnv\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdBool\r
+               Dir:    {Application}\Libraries\StdEnv\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdChar\r
+               Dir:    {Application}\Libraries\StdEnv\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdCharList\r
+               Dir:    {Application}\Libraries\StdEnv\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdClass\r
+               Dir:    {Application}\Libraries\StdEnv\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdEnum\r
+               Dir:    {Application}\Libraries\StdEnv\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdEnv\r
+               Dir:    {Application}\Libraries\StdEnv\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdFile\r
+               Dir:    {Application}\Libraries\StdEnv\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdFunc\r
+               Dir:    {Application}\Libraries\StdEnv\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdInt\r
+               Dir:    {Application}\Libraries\StdEnv\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdList\r
+               Dir:    {Application}\Libraries\StdEnv\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdMisc\r
+               Dir:    {Application}\Libraries\StdEnv\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdOrdList\r
+               Dir:    {Application}\Libraries\StdEnv\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdOverloaded\r
+               Dir:    {Application}\Libraries\StdEnv\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdReal\r
+               Dir:    {Application}\Libraries\StdEnv\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdString\r
+               Dir:    {Application}\Libraries\StdEnv\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   StdTuple\r
+               Dir:    {Application}\Libraries\StdEnv\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   _SystemArray\r
+               Dir:    {Application}\Libraries\StdEnv\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r
+       Module\r
+               Name:   _SystemEnum\r
+               Dir:    {Application}\Libraries\StdEnv\r
+               Compiler\r
+                       NeverMemoryProfile:     False\r
+                       NeverTimeProfile:       False\r
+                       StrictnessAnalysis:     True\r
+                       ListTypes:      StrictExportTypes\r
+                       ListAttributes: True\r
+                       Warnings:       True\r
+                       Verbose:        True\r
+                       ReadableABC:    False\r
+                       ReuseUniqueNodes:       True\r
+                       Fusion: False\r