Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Oct 15th, 2014, 1:12 PM   #1
gaxar77
Newbie
 
Join Date: Nov 2009
Posts: 7
Rep Power: 0 gaxar77 is on a distinguished road
Question NamedPipeServerStream hanging on write operation

I have just started working on a general-purpose library called BlueLib: https://github.com/gaxar77/BlueLib/blob/master/BlueLib/

I am working on an inter process messaging mechanism using named pipes. The problem is that when a message comes through one pipe and is sent out by the server to another, the write operation hangs and the read operations hangs in the client. I do not understand why this is happening. All the files are shown at the above link. The server hangs at the following location in MessageUtility.cs

        public static bool WriteElement(PipeStream stream, XElement element)
        {
            string elementText = element.ToString();
            byte[] bytes = Encoding.Unicode.GetBytes(elementText);

            try
            {
                stream.Write(bytes, 0, bytes.Length);

                return true;
            }
            catch (Exception exception)
            {
                return false;
            }
        }

Does anyone have any idea as to what is going on?
gaxar77 is offline   Reply With Quote
Old Oct 24th, 2014, 8:48 AM   #2
King
Professional Programmer
 
King's Avatar
 
Join Date: Jan 2006
Location: Ontario, Canada
Posts: 771
Rep Power: 12 King is on a distinguished road
Re: NamedPipeServerStream hanging on write operation

Exception are tasty!
__________________
I am Addicted to Linux!
King is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Issues with set_session_save_handler: read() called before write() Saruman_W PHP 0 Aug 28th, 2013 3:41 PM
need some help on writing a code that display and write the result to a file rax_7 C++ 1 Oct 13th, 2010 7:48 PM
low level file operation (with read, write) in linux neuname C 5 Jun 12th, 2010 3:55 PM
write chm-file using ole32.dll UOksana C# 0 Apr 20th, 2009 5:47 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:20 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC