Jump to content
  • Advertisement
Sign in to follow this  
Tano_ITA

Client/Server Client/Client Connection

This topic is 3667 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, i'm working on a 3D Chat (WINSOCK and C++) and i need to know some suggest about a Public Chat and a Private Chat. For Example: In public chat i can send all message to server and the server send this messages to all client connected. And there i've no problem. The problem is when i try to connect two client for a private chat. In a private chat the messages don't will go to the server, but the messages are sended directly to another client. So i've implemented a thread for a "little server" into the client. But i've some problem with the port. I need to know where i can learn something about this tecnique. Thanks a lot. And sorry for my bad english!

Share this post


Link to post
Share on other sites
Advertisement
You could just have a flag in the packet (if its private) and only send that message to the correct person instead of broadcasting it to everyone else.

Edit: All of which would pass through the server.

Share this post


Link to post
Share on other sites
Quote:
Original post by Imgelling
You could just have a flag in the packet (if its private) and only send that message to the correct person instead of broadcasting it to everyone else.

Edit: All of which would pass through the server.


Yes ok, that's work fine. But i need a peer to peer connection to send data like WebCam Streaming or Audio streaming. So i can't use the server to send this data type.

Share this post


Link to post
Share on other sites
I've another problem: When i try so send multiple message to all client connected to my Server, i lost some messages. I use a structure like this:


for(itl = m_SClient.begin(); itl != m_SClient.end(); ++itl)
{
iStat = send(sRecSocket, msg.c_str() , msg.size()+1, 0);
cout<<iStat<<"\n";
}

Share this post


Link to post
Share on other sites
And... if you send it like this, in a for loop, and you are using udp, you probalby is using more bandwith than you have avaliable, it causes more packets to be drop than the usual.

Share this post


Link to post
Share on other sites
Quote:
Original post by Tano_ITA
I've another problem: When i try so send multiple message to all client connected to my Server, i lost some messages. I use a structure like this:


TCP or UDP? Blocking or non-blocking?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!