[R-gregmisc-commits] r2160 - in pkg/gtools: man tests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jun 13 00:52:41 CEST 2017


Author: warnes
Date: 2017-06-13 00:52:41 +0200 (Tue, 13 Jun 2017)
New Revision: 2160

Modified:
   pkg/gtools/man/setTCPNoDelay.Rd
   pkg/gtools/tests/test_setTCPNoDelay.R
Log:
Add improved example to man page for setTCPnoDelat() and fix test function.

Modified: pkg/gtools/man/setTCPNoDelay.Rd
===================================================================
--- pkg/gtools/man/setTCPNoDelay.Rd	2017-06-12 22:51:21 UTC (rev 2159)
+++ pkg/gtools/man/setTCPNoDelay.Rd	2017-06-12 22:52:41 UTC (rev 2160)
@@ -46,8 +46,17 @@
   }
 \examples{
 \dontrun{
-   s <- make.socket(host='www.r-project.org', port=80)
-   setTCPNoDelay(s, value=TRUE)
+host <- "www.r-project.org"
+socket <- make.socket(host, 80)
+print(socket)
+setTCPNoDelay(socket, TRUE)
+
+write.socket(socket, "GET /\n\n")
+write.socket(socket, "A")
+write.socket(socket, "B\n")
+while( (str <- read.socket(socket)) > "")
+  cat(str)
+close.socket(socket)
 }
 
 }

Modified: pkg/gtools/tests/test_setTCPNoDelay.R
===================================================================
--- pkg/gtools/tests/test_setTCPNoDelay.R	2017-06-12 22:51:21 UTC (rev 2159)
+++ pkg/gtools/tests/test_setTCPNoDelay.R	2017-06-12 22:52:41 UTC (rev 2160)
@@ -30,14 +30,14 @@
 
 
 
-host <- "rdgas05026.am.boehringer.com"
-#host <- "www.r-project.org"
+host <- "www.r-project.org"
 socket <- make.socket(host, 80)
 print(socket)
 setTCPNoDelay(socket, TRUE)
 
 write.socket(socket, "GET /\n\n")
-write.socket(socket, "A\0B\n")
+write.socket(socket, "A")
+write.socket(socket, "B\n")
 while( (str <- read.socket(socket)) > "")
   cat(str)
 close.socket(socket)



More information about the R-gregmisc-commits mailing list