Skip to content

Commit

Permalink
Add some debug to help see how publish responses are being sent
Browse files Browse the repository at this point in the history
  • Loading branch information
locka99 committed Mar 23, 2017
1 parent ddec290 commit f65b097
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions server/src/comms/tcp_transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ impl TcpTransport {
debug!("Got message from timer {:?}", result);
match result {
SubscriptionEvent::Messages(messages) => {
debug!("Received messages, sending them out");
for message in messages {
debug!("Message {:#?}", message);
let _ = self.send_response(0, &message, &mut out_buf_stream);
}
}
Expand Down
4 changes: 3 additions & 1 deletion server/src/subscriptions/subscription.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,11 @@ impl Subscription {
monitored_item_notifications.push(monitored_item.get_notification_message().unwrap());
}
}
if !monitored_item_notifications.is_empty() {
if monitored_item_notifications.len() > 0 {
// Create a notification message in the map
self.last_sequence_number += 1;
let sequence_number = self.last_sequence_number;
debug!("Monitored items, seq nr = {}, nr notifications = {}", sequence_number, monitored_item_notifications.len());
let notification = NotificationMessage::new_data_change(sequence_number, &DateTime::now(), monitored_item_notifications);
self.notifications.insert(sequence_number, notification);
true
Expand Down Expand Up @@ -497,6 +498,7 @@ impl Subscription {
};
let result = self.notifications.remove(&first_key);
self.more_notifications = !self.notifications.is_empty();
debug!("Returning notifications, more_notifications = {}", self.more_notifications);
result
} else {
None
Expand Down

0 comments on commit f65b097

Please sign in to comment.