Click here to Skip to main content
15,912,897 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Appoint help: Pin
led mike14-Nov-07 8:51
led mike14-Nov-07 8:51 
GeneralRe: Appoint help: Pin
Hakan Bulut15-Nov-07 5:39
Hakan Bulut15-Nov-07 5:39 
AnswerRe: Appoint help: Pin
Mark Salsbery14-Nov-07 7:32
Mark Salsbery14-Nov-07 7:32 
GeneralRe: Appoint help: [modified] Pin
Hakan Bulut14-Nov-07 7:47
Hakan Bulut14-Nov-07 7:47 
GeneralRe: Appoint help: Pin
Mark Salsbery14-Nov-07 8:01
Mark Salsbery14-Nov-07 8:01 
Question.PCH size slowing compilation? Pin
hairy_hats14-Nov-07 6:25
hairy_hats14-Nov-07 6:25 
AnswerRe: .PCH size slowing compilation? Pin
toxcct14-Nov-07 6:28
toxcct14-Nov-07 6:28 
QuestionAsynchronous overlapped I/O Pin
racette14-Nov-07 5:07
racette14-Nov-07 5:07 
Hi C++ coders,

Im developping two softwares that need to communicate with each other over a network. The IPC mechanism we chose is the named pipes. Both softwares are being developped in C++.

When I did my preliminary tests, everything went fine but performance was not that good. I read that I needed to send and receive data asynchronously, which made sense to me.

So I changed everything to incorporate asynchronous overlapped I/O.

Here is what my softwares do:

Software A creates about a dozen named pipes.

Software B connects to those pipes.

Now, software A sends data through pipe #1. Pipe #1 was designed to send and receive blocks of 112 bytes. This data is received correctly by software B.

Up to here, everything is ok.

Then, software A sends data through pipe #2. Pipe #2 was designed to send and receive blocks of 153,268 bytes. This data is NOT received correctly by software B.

When I do my tests locally (on one pc running both softwares), this block of 153,268 bytes is sent and received correctly.

So my assumption is that there is something wrong with sending and receiving large blocks of data through named pipes over a network.

I read on different forums that there is a limit on the size of data that can be sent through named pipes over a network.

I tried everything I could find on the Internet, but didnt find anything that would work.

My questions are:

If a ReadFile or WriteFile call returns false, and that GetLastError() returns ERROR_IO_PENDING, what should I do to make sure the data is written or read entirely?

Should I call GetOverlappedResult()?

Does a call to GetOverlappedResult() keeps on reading or writing or should I call WriteFile or ReadFile again and again until its done?

Should I wait for the event that was specified to the Overlapped structure?

If someone asks, I can post the code I use.

Thanks.

Benjamin Racette
CAE software developer
racette@cae.com

AnswerRe: Asynchronous overlapped I/O Pin
led mike14-Nov-07 5:21
led mike14-Nov-07 5:21 
GeneralRe: Asynchronous overlapped I/O Pin
racette14-Nov-07 5:39
racette14-Nov-07 5:39 
GeneralRe: Asynchronous overlapped I/O Pin
led mike14-Nov-07 6:30
led mike14-Nov-07 6:30 
GeneralRe: Asynchronous overlapped I/O Pin
racette14-Nov-07 8:54
racette14-Nov-07 8:54 
GeneralRe: Asynchronous overlapped I/O [modified] Pin
led mike14-Nov-07 10:49
led mike14-Nov-07 10:49 
GeneralRe: Asynchronous overlapped I/O Pin
racette14-Nov-07 11:13
racette14-Nov-07 11:13 
GeneralRe: Asynchronous overlapped I/O Pin
led mike14-Nov-07 11:45
led mike14-Nov-07 11:45 
GeneralRe: Asynchronous overlapped I/O Pin
racette14-Nov-07 11:54
racette14-Nov-07 11:54 
GeneralRe: Asynchronous overlapped I/O Pin
led mike15-Nov-07 4:29
led mike15-Nov-07 4:29 
GeneralRe: Asynchronous overlapped I/O Pin
racette16-Nov-07 7:29
racette16-Nov-07 7:29 
GeneralRe: Asynchronous overlapped I/O Pin
led mike16-Nov-07 20:43
led mike16-Nov-07 20:43 
GeneralRe: Asynchronous overlapped I/O Pin
racette19-Nov-07 7:23
racette19-Nov-07 7:23 
GeneralRe: Asynchronous overlapped I/O Pin
led mike19-Nov-07 7:49
led mike19-Nov-07 7:49 
GeneralRe: Asynchronous overlapped I/O Pin
racette19-Nov-07 8:33
racette19-Nov-07 8:33 
GeneralRe: Asynchronous overlapped I/O Pin
racette19-Nov-07 8:49
racette19-Nov-07 8:49 
GeneralRe: Asynchronous overlapped I/O Pin
racette23-Nov-07 4:16
racette23-Nov-07 4:16 
GeneralRe: Asynchronous overlapped I/O Pin
led mike26-Nov-07 4:56
led mike26-Nov-07 4:56 

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.