Click here to Skip to main content
15,889,266 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: why there is so many different between debug and release? Pin
Roger Allen19-Apr-02 1:45
Roger Allen19-Apr-02 1:45 
GeneralRe: why there is so many different between debug and release? Pin
Michael Dunn19-Apr-02 11:51
sitebuilderMichael Dunn19-Apr-02 11:51 
GeneralConverter Pin
18-Apr-02 23:48
suss18-Apr-02 23:48 
GeneralRe: Converter Pin
Michael P Butler19-Apr-02 0:02
Michael P Butler19-Apr-02 0:02 
GeneralRe: Converter Pin
Alvaro Mendez19-Apr-02 8:25
Alvaro Mendez19-Apr-02 8:25 
GeneralC++ 101 question Pin
_Magnus_18-Apr-02 23:18
_Magnus_18-Apr-02 23:18 
GeneralRe: C++ 101 question Pin
Joaquín M López Muñoz19-Apr-02 0:52
Joaquín M López Muñoz19-Apr-02 0:52 
Questionbroadcast socket messages to clients but how? Pin
Atilla Selem18-Apr-02 23:08
Atilla Selem18-Apr-02 23:08 
Hi,
i have been writing a chat program both server side and client side by using MFC CAsyncSocket Class and i had succeded to implement and chat on our LAN at job.
It is really a good experience for me in both learning C++ and Visual C6.0 media. i have just wanted to consult ur precious knowledge about something i could not implement in my server side App.
Let me talk about a little bit about how Apps work:
İn My Server App, i create a Server Socket and make it listen for connection requests from clients. Clients ("these are my job friends.Smile | :) ..") make connections using my client App to my server App. so, i really know what happens at both side. When people connect to server, all they can talk to the same room and everybody sees what others said and they can whisper special messages to special users if they want like ordinary chat programs as well. Server handles every user information ( user name, IP_Address, OnOff time, Incoming Messages...etc,) in a structure that is a linked list created dynamically when each user connects and disconnects. Server adds and deletes all users to a dynamically created Socket Linked List. i also thought to try to create individual threads for each user connecting but since Linked list worked i gave up.

What is my problem is that. When someone writes a message while in room chat, Server takes this message from that user and sends it back to all users that are online ONE BY ONE. By this way everybody sees the written message in their Client App. It is not efficient for Server Processing time to distribute one message to all users one by one. It would be efficient for Server App to SEND BROADCAST messages to all users at one time. But since i don't use Windows Sockets but MFC i could not find my way.

Is it possible to send BROADCAST message while my server Socket and Client sockets are STREAM_SOCKET type ( i created my sockets from that type)
or is BROADCASTING a subject of only DATAGRAM_SOCKET type.
i don't know what will i do. Should i change my Application structure or is there another way that solves my problem.
i really think the future when lots of people connects and sends messages simultaneously. Server also handles a database that keeps special user information ( name, age, gender, height, weight, email adds...etc) and adds deletes and updates and sends them back whenever a user wants to see his/her user details like on ICQ.

So for my server App, dealing with all these tasks takes time and i want to use my Server Processing as efficient as possbile.

Thanks for ur helps...

Yours respectfully,

Atilla Selem
Electronics Engineer,
Aselsan A.Ş
www.aselsan.com.tr


willing to learn and teach
AnswerRe: broadcast socket messages to clients but how? Pin
Jon Hulatt18-Apr-02 23:21
Jon Hulatt18-Apr-02 23:21 
GeneralRe: broadcast socket messages to clients but how? Pin
Atilla Selem18-Apr-02 23:57
Atilla Selem18-Apr-02 23:57 
AnswerRe: broadcast socket messages to clients but how? Pin
Albert Pascual19-Apr-02 6:32
sitebuilderAlbert Pascual19-Apr-02 6:32 
Generalto find the windows version Pin
karanba18-Apr-02 22:43
karanba18-Apr-02 22:43 
GeneralRe: to find the windows version Pin
Jon Hulatt18-Apr-02 23:24
Jon Hulatt18-Apr-02 23:24 
GeneralRe: to find the windows version Pin
Tom Archer20-Apr-02 17:50
Tom Archer20-Apr-02 17:50 
Generalto find the windows version Pin
karanba18-Apr-02 22:38
karanba18-Apr-02 22:38 
GeneralRe: to find the windows version Pin
moliate19-Apr-02 7:05
moliate19-Apr-02 7:05 
Generaldisable/enabled minimize & close button Pin
NikoTanghe18-Apr-02 22:31
NikoTanghe18-Apr-02 22:31 
GeneralRe: disable/enabled minimize & close button Pin
Paul M Watt19-Apr-02 5:53
mentorPaul M Watt19-Apr-02 5:53 
GeneralRe: disable/enabled minimize & close button Pin
NikoTanghe21-Apr-02 21:25
NikoTanghe21-Apr-02 21:25 
GeneralSelected text in memory Pin
Kemal OZLU18-Apr-02 21:45
Kemal OZLU18-Apr-02 21:45 
GeneralRe: Selected text in memory Pin
Paul M Watt19-Apr-02 5:46
mentorPaul M Watt19-Apr-02 5:46 
GeneralRe: Selected text in memory Pin
Kemal OZLU19-Apr-02 13:04
Kemal OZLU19-Apr-02 13:04 
GeneralRe: Selected text in memory Pin
Paul M Watt19-Apr-02 13:47
mentorPaul M Watt19-Apr-02 13:47 
GeneralUnlimited Socket receive Pin
Kristian3318-Apr-02 21:17
Kristian3318-Apr-02 21:17 
GeneralRe: Unlimited Socket receive Pin
18-Apr-02 23:07
suss18-Apr-02 23:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.