MongoDBDriver/Connection.cs
/// <summary>
/// Used for sending a message that gets a reply such as a query.
/// </summary>
/// <param name="msg"></param>
/// <returns></returns>
/// <exception cref="IOException">A reconnect will be issued but it is up to the caller to handle the error.</exception>
Used for sending a message that gets a reply such as a query.
Used for sending a message that gets a reply such as a query .
public ReplyMessage SendTwoWayMessage(RequestMessage msg){
            if (this.State != ConnectionState.Opened){
                throw new MongoCommException("Operation cannot be performed on a closed connection.", this);
            }
            try{
                ReplyMessage reply = new ReplyMessage();
                lock(tcpclnt){
                    msg.Write(tcpclnt.GetStream());
                    reply.Read(tcpclnt.GetStream());
                }
                return reply;
            }catch(IOException){
                this.Reconnect();
                throw;
            }
        }
public ReplyMessage SendTwoWayMessage ( RequestMessage msg ) { if ( this . State != ConnectionState . Opened ) { throw new MongoCommException ( " " , this ) ; } try { ReplyMessage reply = new ReplyMessage ( ) ; lock ( tcpclnt ) { msg . Write ( tcpclnt . GetStream ( ) ) ; reply . Read ( tcpclnt . GetStream ( ) ) ; } return reply ; } catch ( IOException ) { this . Reconnect ( ) ; throw ; } }
Used for sending a message that gets a reply such as a query.
Used for sending a message that gets a reply such as a query .
None
A reconnect will be issued but it is up to the caller to handle the error.
A reconnect will be issued but it is up to the caller to handle the error .
msg
RequestMessage
None