custom timeout, nodelay flag and encoding