Added server connection code.