finish tcp sending and some tests