Your question is very broad, especially that it is not aimed at a specific programming problem. I will give you some recommendations or a starting point.
For iPhone, you need to learn how to work with NSStream , and you can start here: Flow Programming Guide for Cocoa . You will need an output stream and an input stream so that you can easily and simultaneously control the outgoing and incoming communications. In other words, you will benefit from the NSInputStream and NSOutputStream , which are derived from the main NSStream class. When you send data using streams, you will send raw data using uint8_t buffers, so it is not necessary to use JSON packets; I personally do not do this, but it is up to you.
On Windows, I assume that you will use C #, so you will need to find out a TcpListener that listens for a specific IP address and a specified port number. This may help you a bit: TcpListener Class . You will also need TcpClient , through which you will read and write to the stream.
For an efficient server, you need to work asynchronously, and TcpClient has synchronous and asynchronous methods for this. In addition, to improve functionality, you may need to use streams on your server or use the built-in BackgroundWorker class, which makes things much easier.
I do not propose to program the client on my own, and then the server, I believe that they should go in parallel, because it is a two-way communication, and if you try, you will see that you have to work a little here and a little there. It is not surprising if I tell you that when I work on my client / server application, I have a Mac and a PC on my desk, and I switch between them every time.
Finally, I would like to comment on what you did not ask. Since your client is a mobile device, you should expect that it is not always turned on (or will not always be connected to the Internet), so be prepared to have a database running on the server in order to be able to store messages that need to be sent later. .
Hope this helps you get started. If you have a more specific question, I could better illustrate. By the way, this work is not so easy, but it's great if you really like programming, especially when you start getting your first results;)