Click here to Skip to main content
15,905,144 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionInteractive Service on Vista Pin
Peter Weyzen15-Sep-08 12:58
Peter Weyzen15-Sep-08 12:58 
AnswerRe: Interactive Service on Vista Pin
Mark Salsbery15-Sep-08 13:19
Mark Salsbery15-Sep-08 13:19 
AnswerRe: Interactive Service on Vista Pin
Mark Salsbery15-Sep-08 13:41
Mark Salsbery15-Sep-08 13:41 
GeneralRe: Interactive Service on Vista Pin
Peter Weyzen15-Sep-08 14:12
Peter Weyzen15-Sep-08 14:12 
GeneralRe: Interactive Service on Vista Pin
Mark Salsbery15-Sep-08 14:28
Mark Salsbery15-Sep-08 14:28 
GeneralRe: Interactive Service on Vista Pin
Peter Weyzen15-Sep-08 15:24
Peter Weyzen15-Sep-08 15:24 
GeneralRe: Interactive Service on Vista Pin
Mark Salsbery16-Sep-08 7:42
Mark Salsbery16-Sep-08 7:42 
Questionnamed pipes problems Pin
ofeririko15-Sep-08 7:42
ofeririko15-Sep-08 7:42 
Hi,

I've implemented a named pipes server according to microsoft's KB: http://msdn.microsoft.com/en-us/library/aa365588(VS.85).aspx[^]

so far so good ..

the next step was to add timeouts handling. i.e in case the server failed, the connected clients should NOT be blocked and should exit with timouts.

according to the documentations, this should be done using the following procedure:


1. create a file:

m_hPipe = CreateFileA(
m_sPipeName, // pipe name
GENERIC_READ | // read and write access
GENERIC_WRITE,
0, // no sharing
NULL, // default security attributes
OPEN_EXISTING, // opens existing pipe
0, // default attributes
NULL); // no template file

.

2. set timeouts and Setup com:

GetCommTimeouts(m_hPipe,&m_comm_timeout);
m_comm_timeout.ReadIntervalTimeout = MAXDWORD;
m_comm_timeout.ReadTotalTimeoutMultiplier = MAXDWORD;
m_comm_timeout.ReadTotalTimeoutConstant = 1;

SetupComm(m_hPipe, BUFSIZE+3,BUFSIZE+3);
DCB cDCB;
GetCommState(m_hPipe, &cDCB);
SetCommState(m_hPipe, &cDCB);

SetCommTimeouts(m_hPipe, &m_comm_timeout);


3. execute the read file command ...

fSuccess = ReadFile( m_hPipe, // pipe handle
chBuf, // buffer to receive reply
BUFSIZE, // size of buffer
&cbRead,// number of bytes read
NULL); // not overlapped


the above procedure should cause the ReadFile to exit after 100 miliseconds, however, it doesnt seems to work

Any suggestions will be wellcomed ...
AnswerRe: named pipes problems Pin
Roger Stoltz15-Sep-08 10:33
Roger Stoltz15-Sep-08 10:33 
QuestionMessage Only Window? Pin
Joseph Marzbani15-Sep-08 7:22
Joseph Marzbani15-Sep-08 7:22 
AnswerRe: Message Only Window? Pin
James R. Twine15-Sep-08 7:30
James R. Twine15-Sep-08 7:30 
AnswerRe: Message Only Window? Pin
auralius manurung15-Sep-08 17:52
auralius manurung15-Sep-08 17:52 
QuestionStudio Tools - Spy++ Pin
john john mackey15-Sep-08 7:20
john john mackey15-Sep-08 7:20 
QuestionRSA Encryption/Decryption Pin
Kdss15-Sep-08 5:28
Kdss15-Sep-08 5:28 
AnswerRe: RSA Encryption/Decryption Pin
SandipG 15-Sep-08 5:49
SandipG 15-Sep-08 5:49 
Questioncalling a static function Pin
steph515-Sep-08 5:26
steph515-Sep-08 5:26 
AnswerRe: calling a static function Pin
Mark Salsbery15-Sep-08 5:39
Mark Salsbery15-Sep-08 5:39 
GeneralRe: OT Pin
toxcct15-Sep-08 5:44
toxcct15-Sep-08 5:44 
GeneralRe: OT Pin
Mark Salsbery15-Sep-08 5:45
Mark Salsbery15-Sep-08 5:45 
GeneralRe: OT Pin
toxcct15-Sep-08 5:48
toxcct15-Sep-08 5:48 
GeneralRe: OT Pin
Mark Salsbery15-Sep-08 5:59
Mark Salsbery15-Sep-08 5:59 
GeneralRe: OT Pin
john john mackey15-Sep-08 7:24
john john mackey15-Sep-08 7:24 
GeneralRe: OT Pin
David Crow15-Sep-08 5:53
David Crow15-Sep-08 5:53 
GeneralRe: OT Pin
Mark Salsbery15-Sep-08 6:01
Mark Salsbery15-Sep-08 6:01 
GeneralRe: OT Pin
CPallini15-Sep-08 6:10
mveCPallini15-Sep-08 6:10 

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.