Portvakt code for server and basestation