Click here to Skip to main content
15,921,062 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: find all connect system ip address in the network Pin
David Crow25-Nov-08 14:26
David Crow25-Nov-08 14:26 
GeneralRe: find all connect system ip address in the network Pin
Member 470867630-Nov-08 17:37
Member 470867630-Nov-08 17:37 
QuestionCan I disable repainting of a window? [SOLVED] Pin
sashoalm25-Nov-08 0:02
sashoalm25-Nov-08 0:02 
AnswerRe: Can I disable repainting of a window? Pin
Stephen Hewitt25-Nov-08 0:30
Stephen Hewitt25-Nov-08 0:30 
GeneralRe: Can I disable repainting of a window? Pin
sashoalm25-Nov-08 2:26
sashoalm25-Nov-08 2:26 
QuestionAccess denied problem in UAC Enable for removable media Pin
VCProgrammer25-Nov-08 0:02
VCProgrammer25-Nov-08 0:02 
QuestionBlocking recv() in worker thread or async OnReceive()? Pin
atillaselem24-Nov-08 23:07
atillaselem24-Nov-08 23:07 
AnswerRe: Blocking recv() in worker thread or async OnReceive()? Pin
Randor 25-Nov-08 6:04
professional Randor 25-Nov-08 6:04 
atillaselem wrote:
so, what should i do to prevent possible UDP buffer overruns and stabilize processing performance of packets?


There is an internal socket buffer which can be set with the setsockopt Function[^] which I think defaults to 8 kilobytes on Win2k and above with adequate RAM. The buffer size can be increased by setting the SO_RCVBUF[^] option. The socket buffer can be increased up to 64K. You wrote in your opening statement that Reliability is of no importance so this implies that you do not care if there is slight packet loss. If this is the case then the default socket buffer may suffice.


atillaselem wrote:
Should i use individual worker threads for each UDP Socket (WinSocket) in blocking recv() in thread loop?
Should i use implement each UDP socket as CAsyncSocket and override OnReceive()?



Its hard to say what your requirements are without knowing what type of data your packets contain and how long it takes to process the data. CAsyncSocket has fairly good performance for client applications.

atillaselem wrote:
In Asynchronous receiving i think framework uses a thread from internal thread pool and assigns it to call OnReceive whenever socket gets remote data?


Yes somewhat, OnReceive is implemented as a callback function.


atillaselem wrote:
Should i immediately put received bytes in a thread-safe queue or some sort of array and leave the overriden function in OnReceive() case?


If you will be recieving the datagrams from over the internet and have an estimated low throughput then there is no reason why you shouldn't immediately update your application variables with the datagram values by first locking with multiple-readers single-writer synchronization objects.


atillaselem wrote:
What do u offer that will work practically and in reliable/good performance?


Only some advice with an estimated value of 0.02 dollars USD. Big Grin | :-D

Best Wishes,
-David Delaune
GeneralRe: Blocking recv() in worker thread or async OnReceive()? Pin
atillaselem25-Nov-08 7:39
atillaselem25-Nov-08 7:39 
GeneralRe: Blocking recv() in worker thread or async OnReceive()? Pin
Randor 25-Nov-08 8:48
professional Randor 25-Nov-08 8:48 
GeneralRe: Blocking recv() in worker thread or async OnReceive()? Pin
atillaselem25-Nov-08 20:13
atillaselem25-Nov-08 20:13 
QuestionCString AND TCHAR AND [260] Pin
cpvc++24-Nov-08 22:53
cpvc++24-Nov-08 22:53 
QuestionRe: CString AND TCHAR AND [260] Pin
CPallini24-Nov-08 23:30
mveCPallini24-Nov-08 23:30 
AnswerRe: CString AND TCHAR AND [260] Pin
cpvc++24-Nov-08 23:54
cpvc++24-Nov-08 23:54 
GeneralRe: CString AND TCHAR AND [260] Pin
Cedric Moonen25-Nov-08 0:09
Cedric Moonen25-Nov-08 0:09 
GeneralRe: CString AND TCHAR AND [260] Pin
CPallini25-Nov-08 0:11
mveCPallini25-Nov-08 0:11 
GeneralRe: CString AND TCHAR AND [260] Pin
cpvc++25-Nov-08 17:56
cpvc++25-Nov-08 17:56 
GeneralRe: CString AND TCHAR AND [260] Pin
CPallini25-Nov-08 21:18
mveCPallini25-Nov-08 21:18 
AnswerRe: CString AND TCHAR AND [260] Pin
Code-o-mat24-Nov-08 23:34
Code-o-mat24-Nov-08 23:34 
QuestionGet current network domain name Pin
Krishnakumartg24-Nov-08 22:25
Krishnakumartg24-Nov-08 22:25 
AnswerRe: Get current network domain name Pin
SandipG 24-Nov-08 22:32
SandipG 24-Nov-08 22:32 
QuestionGetting current firewall profile Pin
Krishnakumartg24-Nov-08 22:23
Krishnakumartg24-Nov-08 22:23 
AnswerRe: Getting current firewall profile Pin
User 21559725-Nov-08 1:21
User 21559725-Nov-08 1:21 
GeneralRe: Getting current firewall profile Pin
Krishnakumartg26-Nov-08 0:05
Krishnakumartg26-Nov-08 0:05 
Questionslider and MCIWnd Pin
soongez24-Nov-08 21:57
soongez24-Nov-08 21:57 

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.