Removing buffer delay when writing to socket