Update tcp_write.cpp

update to AF_INET, more general use