Start of networking for client app. Some of this might not look exactly right but it contains the basic ideas of how to network.