added: socket routines and main loop. now works with a welcome message only