|
Sorry. I am not much experienced in socket programing.
But if you are going to create a gtalk like application peer to peer model is enough.
- ns ami -
|
|
|
|
|
You could make your server a service.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Answered to me?
- ns ami -
|
|
|
|
|
thanks for your reply ns ami,
And sorry that was for code-o-mate.
anyway,do you mean "cleint-client" by "peer to peer"
I am a beginner
|
|
|
|
|
himangshuS wrote: anyway,do you mean "cleint-client" by "peer to peer"
I am not sure about the terminology. But AFAIK, in peer to peer, server and client will be in the same application. Each application will keep a list of its contacts and at the starting of application it can broadcast or send some messages to each contacts. So that others can know that you are logged in.
This is only my fair concepts...
- ns ami -
|
|
|
|
|
here is one more doubt of me.
How can we broadcast a message actually using MFC socket programing. Is it a for loop and send to each one. Or any syntax is there to broadcast a message to all in a network or may be a set of IP address.
I am a beginner
|
|
|
|
|
That is something with Datagram Sockets...
- ns ami -
|
|
|
|
|
Whoups, sorry, of course i wanted to answer himangshuS, didn't notice i "mis-clicked".
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Code-o-mat wrote: sorry
No problem... It was just to inform you...
- ns ami -
|
|
|
|
|
Oh ya, that sounds pretty interesting and realistic.
But I was thinking that...why do i need a server,can i communicate directly(client to client)?
May the server can give a list of information with IP address and username,thats it. Then the clients can talk to each other directly(not through the server). Is that possible?
regards,
HImangshu S
I am a beginner
|
|
|
|
|
Yes, that is possible.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
fine, so i guess i can go ahead a simple client-client design with a limited server application which will send to the client for the IP-username mapping.
But, here again i need to maintain some table structure. I am new to MFC. can I use ms access here?
I am a beginner
|
|
|
|
|
I think you can but i have never worked with access so i can't help you with it.
Plan your chat-protocol carefully, remember that your clients will probably need to be notified of certain events like someone going offline or coming online...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
oh ya that could be also one more problem. I haven't thought about it only.
But I guess we can broadcast a special message(going offline) to all. Instead of events notifications.
Am I correct?
I am a beginner
|
|
|
|
|
How would you broadcast that?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Let me explain you that one,
1.Do not start with Dialog or Doc/View conversation. First think about implementing your chat/messaging mechanism. I guess you have been coming around MFC sockets. If you ask me, I'm not for it.I did not like to work with it. You can directly use winsock2.
2. Write a simple TCP client server application in console mode. Once you find the application running and you are clear with the idea, make a simple class that takes care of simple functionalities like connecting, sending & accepting messages.
3. First try for single client-server application. When you are comfortable with it you can move to Multi-client application that would involve threading in most cases.
4. Now you are clear with Sending & receiving messages using winsock.
5. For server part, you can ultimately go for windows services implementation, but to start with I do not recommend it. Because as you are a beginner, you will have to trouble shoot a lot of things at first. So just make it a console server. Where you'll be able to view the messages going across.
6. For client, you can have it as Dialog application, but again it's just based on the need. You can even go for SDI if you want to make use of Serialize-Archive functionality of the document. It could be useful when you save down your chat conversation.
7. Did I answer you?
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
A sincere thanks for your reply
Got lots idea from you.Specially the steps i should follow. it sounds very professional.
VuNic wrote: You can directly use winsock2.
what is winsock2? is it for MFC? is there any advantage on normal socket functions like listen/bind/createsocket etc (which I have worked on little bit).
I am a beginner
modified on Monday, March 9, 2009 9:34 AM
|
|
|
|
|
himangshuS wrote: what is winsock2? is it for MFC? is there any advantage on normal socket functions like listen/bind/createsocket etc (which I have worked on little bit).
lol. winsock is called - normal sockets. MFC just wraps around. You will get better understanding if you go for winsock API. I don't force you to leave MFC, but that's not my choice when it comes to sockets. Nishant Shivakumar has a neatly written TCP client server application. I'd recommend you to start with that. wait let me check it.
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
Clikt[^]
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
thnaks
could you please tell me if my design is correct.
server
->Maintains a list of Ip_Address-user. Always in listen mode, so that if someone ask for the list it sends it.
-> If the admin adds a new user, he will re-send the list to all (but I am not sure, how to do it,when if the clients are busy sending message. should i restart all or do something)
client
-> on boot/application start, it request server and get the list(His IP-username should be present in the list). And sends a message that he is online to all.
->if he goes offline- he will notify everyone and the go offline.
so basically only those people who are listed in the server by admin can only chat
|
|
|
|
|
Your questions are at times too open & wide. Try with simple implementation, once you get the picture you can design your complete application.
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
|
lol the author of that article has taken screen shots of those widows with his junk desktop on the background!
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
I have just write some code for your question. I hope it will give you any help.But I cannt submit one article. Can you tell me your E-mail? I will send to you.
modified on Tuesday, March 10, 2009 3:30 AM
|
|
|
|
|
oh thanks a lot....
himangshu_802@yahoo.co.in
I am a beginner
|
|
|
|