advice needed on how to approach this, passing around strings
Hello everyone,
I'm new to network programming and I was just wondering if I could get some clarification and some advice on networking.
Right now I have a serversocket program that accepts a connection from another server that is sending large strings (events), my server socket program takes these strings (events) and parses them and up stores them into an object and then into a multi-map.
Now I'm going to take these events and turn them into a string again, and send them to a receiver.
I'm confused on the processes of how this will happen.
My Sever Socket program creates a server socket, and listens on port 5656, the program thats sending me the strings (events) connects to socket 5656, and starts sending me data.
Now once this data is processed and stored as a message object, then what do I have to do to send it off to another program?
Do I open up another Sever Socket, and listen on port 5000, then when that other reciever program connects to 5000 it will start sending those strings to it?
If this is the case, what if there is no connection to 5000 to recieve the strings I'm going to send to it? Would I need to maybe store all the strings in a vector and when the client connects to port 5000, should I just start sending them from the vector?
Or should the recieving application be also a server? So as soon as I get my first string, I can just use the Socket class, rather than the ServerSocket to create a connection like:Socket echoSocket = new Socket("taranis", 5000); Asumming taranis is the name of the server that wants the strings I parsed.
So my application will have a SocketServer to accept the incoming string, then it will create a Socket and connect to another server to send the string?
Thanks :D

