Found the real problem that causes the mal function of the stream communication:
 - We created a session object in SessionContainer.
 - When we start the DataOutputStreamController in the method startStreamWithName we assign the object session to property of DataOutputStreamController that was already initialize. If we define this one as an optional variable, everything works perfectly.

I do not understand the real reason behind this problem.

But the fact was that it was as the session object was working anomaly causing multiple errors
Fixing a problem in the reception. The rxData: NSMutableData where we are storing the bytes received through the inputStream was not initialize the first time, causing an exception.