Click here to Skip to main content
15,917,005 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralAFXWIN1.INL assertion Pin
ikasovitch5-May-05 22:31
ikasovitch5-May-05 22:31 
GeneralRe: AFXWIN1.INL assertion Pin
David Crow6-May-05 3:52
David Crow6-May-05 3:52 
GeneralRe: AFXWIN1.INL assertion Pin
ikasovitch6-May-05 4:19
ikasovitch6-May-05 4:19 
GeneralRe: AFXWIN1.INL assertion Pin
David Crow6-May-05 4:40
David Crow6-May-05 4:40 
GeneralRe: AFXWIN1.INL assertion Pin
Anonymous6-May-05 20:23
Anonymous6-May-05 20:23 
GeneralRe: AFXWIN1.INL assertion Pin
David Crow7-May-05 8:15
David Crow7-May-05 8:15 
GeneralUDP - share port between sockets Pin
ally_s5-May-05 22:18
ally_s5-May-05 22:18 
GeneralRe: UDP - share port between sockets Pin
PerfectDark6-May-05 2:13
PerfectDark6-May-05 2:13 
No, I'm afraid you cant do this with datagram (UDP) sockets. you can do this with stream (tcp) sockets, by calling the accept() function, this will give you a new socket per connection, these sockets can then be passed to separate threads for processing.

The only way to do what you want is to have a single loop receiving packets with the recvfrom() function, this will return the address of the sender of the packet. then for each client, have a queue of that you put that packet into, have then a thread for each cleint that reads the next packet from the respective queue and processes it. Each thread can have a copy of the original socket handle so that they can send to their respective clients.

hope this helps.
GeneralRe: UDP - share port between sockets Pin
ally_s6-May-05 5:26
ally_s6-May-05 5:26 
GeneralRe: UDP - share port between sockets Pin
PerfectDark6-May-05 5:54
PerfectDark6-May-05 5:54 
GeneralSocket Programming Pin
Tuscon5-May-05 21:44
Tuscon5-May-05 21:44 
QuestionHow I Read MBR Master Boot Record Pin
shahzad Ahmed5-May-05 21:43
shahzad Ahmed5-May-05 21:43 
AnswerRe: How I Read MBR Master Boot Record Pin
Alexander M.,6-May-05 3:27
Alexander M.,6-May-05 3:27 
QuestionHow to save the complete web page without prompting save..as dialog box Pin
Tcpip20055-May-05 21:04
Tcpip20055-May-05 21:04 
QuestionWTL, ATL, STL...duhh? Pin
Mridang Agarwalla5-May-05 21:02
Mridang Agarwalla5-May-05 21:02 
AnswerRe: WTL, ATL, STL...duhh? Pin
«_Superman_»5-May-05 23:15
professional«_Superman_»5-May-05 23:15 
GeneralRe: WTL, ATL, STL...duhh? Pin
Maximilien6-May-05 2:32
Maximilien6-May-05 2:32 
GeneralNetwork Programming Pin
Mridang Agarwalla5-May-05 20:58
Mridang Agarwalla5-May-05 20:58 
GeneralRe: Network Programming Pin
xcavin5-May-05 22:11
xcavin5-May-05 22:11 
GeneralRe: Network Programming Pin
ThatsAlok6-May-05 1:29
ThatsAlok6-May-05 1:29 
Generalmultithreading in c++ Pin
Mridang Agarwalla5-May-05 20:55
Mridang Agarwalla5-May-05 20:55 
GeneralRe: multithreading in c++ Pin
David Crow6-May-05 3:55
David Crow6-May-05 3:55 
QuestionNeed SDK ?? Pin
VCSharp0075-May-05 20:51
VCSharp0075-May-05 20:51 
AnswerRe: Need SDK ?? Pin
RChin5-May-05 22:38
RChin5-May-05 22:38 
AnswerRe: Need SDK ?? Pin
David Crow6-May-05 3:58
David Crow6-May-05 3:58 

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.