Added connect and accept implementation