Write queue after connect windows

Move this one to pipe.c