locked
SocketStream Comunication is not working in the release mode RRS feed

  • Question

  • Hi people,

    I wrote a Server-Application using TcpClient and TcpListener then I use a GetSteam to make a StreamWriter and StreamReader, so my comunication between Client and Server works, but only in Debugkonfiguration not in Releasekonfiguration.

    In the Release the Server accepts the Client i.e. the Socket is created but I can not send messages by the StreamWriter or StreamReader, when ever I Flush the message.

    Is any thing I can do to solve the problem?

    thank you for answering .......

     

    Thursday, March 23, 2006 1:56 PM

Answers

  • Check the scope of the variables. Make sure the variables are alive till the end of the program. Usually in debug mode, even if the variables are not used after the call they are kept alive explicitly. but in release mode, they are optimized. So if a variable is assigned to but not used lateron, it maybe immediately  GCed.

    If it doesnt work still, Can you post repro code

    Friday, March 24, 2006 7:26 PM

All replies

  • Can you try without using the stream writer and stream reader?
    There may be associated buffering and locking going on in sharing the same stream across Reader and Writer.
    If you can try without using the reader/writer we can figureout what could the issue with reader/writer
    Thursday, March 23, 2006 2:57 PM
    Moderator
  • Check the scope of the variables. Make sure the variables are alive till the end of the program. Usually in debug mode, even if the variables are not used after the call they are kept alive explicitly. but in release mode, they are optimized. So if a variable is assigned to but not used lateron, it maybe immediately  GCed.

    If it doesnt work still, Can you post repro code

    Friday, March 24, 2006 7:26 PM