tests/test_setTCPNoDelay.R

library('gtools')

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)

Try the gtools package in your browser

Any scripts or data that you put into this service are public.

gtools documentation built on June 26, 2018, 5:01 p.m.