Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

Commit

Permalink
Removed old commented code
Browse files Browse the repository at this point in the history
Allowed incoming byte functionality to be overriden by the subclass.
Added documentation.
  • Loading branch information
DJGosnell committed Aug 30, 2016
1 parent 7955b9f commit bd2fcc2
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions DtronixMessageQueue/MqSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ internal void ProcessOutbox() {
// Send the last of the buffer queue.
SendBufferQueue(buffer_queue, length);
}
//Postmaster.SignalWriteComplete(this);
}

/// <summary>
Expand Down Expand Up @@ -197,11 +196,25 @@ internal void ProcessIncomingQueue() {
//Postmaster.SignalReadComplete(this);

if (messages != null) {
IncomingMessage?.Invoke(this, new IncomingMessageEventArgs<TSession>(messages, this));
OnIncomingMessage(this, new IncomingMessageEventArgs<TSession>(messages, this));
}
}

/// <summary>
/// Event fired when one or more new messages are ready for use.
/// </summary>
/// <param name="sender">Originator of call for this event.</param>
/// <param name="e">Event args for the message.</param>
public virtual void OnIncomingMessage(object sender, IncomingMessageEventArgs<TSession> e) {
IncomingMessage?.Invoke(sender, e);
}


/// <summary>
/// Closes this session with the specified reason.
/// Notifies the other end of this connection the reason for the session's closure.
/// </summary>
/// <param name="reason">Reason for closing this session.</param>
public override void Close(SocketCloseReason reason) {
if (CurrentState == State.Closed) {
return;
Expand Down Expand Up @@ -272,6 +285,10 @@ protected virtual void ProcessCommand(MqFrame frame) {
}
}

/// <summary>
/// String representation of the active session.
/// </summary>
/// <returns>String representation.</returns>
public override string ToString() {
return $"MqSession; Reading {inbox_byte_count} bytes; Sending {outbox.Count} messages.";
}
Expand Down

0 comments on commit bd2fcc2

Please sign in to comment.