- This topic has 1 reply, 2 voices, and was last updated 13 years ago by
Anonymous.
-
AuthorPosts
-
June 26, 2013 at 09:04 #950
Anonymous
InactiveHi,
Thanks for the help so far, it has been really helpful. I have a couple of other questions which I hope you can help me with or give me some guidelines.We are still working on the same pokerclient as mentioned earlier and I have been able to send and recieve the information from/to the server/client and the framework is very good and easy, however I need to setup a different approach right now.
Please have a look at this picture:
http://postimg.org/image/cdok8yqp9/The only thing that the clients should do is:
1. Connect and Disconnect to the server
2. Send its action to the server (Call, Raise, Fold etc.)
3. Animate based on the data recieved from the serverThe server should:
1. Store all connections from the client
2. Send the appropiate data to each clientI was wondering what a good approach would be here using NetworkComms Framwork?
Right now I send and recieve data from and to the server a little bit sloppy and I would like to redo that part so any input here on how to handle the client connections etc. would be highly appreciated!
Thanks in advance,
Best regards,
TomasThanks in advance,
Best regards,
TomasJune 26, 2013 at 10:35 #951Anonymous
InactiveHeya Tomas,
Good to hear you are making progress. The best answer to your question is that you can decide what the best communication configuration is and then use Networkcomms.Net to implement it. You are not really restricted to one configuration over another. A very brief example of what you might be able to use is:
List<IPEndPoint> connectedClients = new List<IPEndPoint>(); NetworkComms.AppendGlobalIncomingPacketHandler<string>("InitialClientConnect", (header, connection, message) => { //If a client sends a InitialClientConnect packet we add them to the connectedClients list connectedClients.Add(connection.ConnectionInfo.RemoteEndPoint); });and
//At some future point we can send something to all connected clients string messageToSend = "helloWorld"; foreach (IPEndPoint endPoint in connectedClients.ToList()) { try { TCPConnection.GetConnection(new ConnectionInfo(endPoint)).SendObject("TestMessage", messageToSend); } catch (CommsException ex) { //An exception occured. Inspect the exception 'ex' to determine what went wrong //It might be the client is no longer available } }Regards,
Marc -
AuthorPosts
- You must be logged in to reply to this topic.
