Do syswrite in a loop

for issue #78

When use SSL socket, it seems to not able to write content of 16KB or more in a single syswrite.
do syswrite in a while-loop.