There is no much difference if this is the same machine or a different machine, from the standpoint of development. The server side is playing passive role: it is listening for the new connection and, before some application is connected, knows nothing about the clients. The client part needs to know IP address and the port number of the server side. Or, it can be the name resolved through DNS. Additionally, on the same machine, these name could be "localhost". That's all.
Now, usually you need to write such software, or use some more or less universal messaging middleware instead. This is why: there is not "just TCP networking". You always have some
application-level protocol which defines the discipline and some requirements for content sent/received through the network stream/channel. Please see:
http://en.wikipedia.org/wiki/Application_layer[
^].
Without specifying of the platform, implementation language and maybe some libraries/frameworks to be used, the whole question makes little to no sense.
—SA