Fix #398 remember server port rather than ask server for its port each time