This is no server code, I see only two different client codes. For socket communication you need a socket server. I think you can establish a socket server by calling session_open but I havent tried it.

For sending between two programs I do not use socket functions, but send_data, this works fine and has a more reliable protocol than socket communication. You can check out the pong_multiplayer.c for an example.