before write, check whether socket is writable.
print out raw packet info & implement isConnected function.