smart socket(partial write)