Skip to content

Commit

Permalink
Messages are received properly by darklight_driver.
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanMcMillan54 committed Nov 3, 2024
1 parent c063567 commit 8341895
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,12 @@ impl DarkLightDistributor {

let ri = ReceiveInfo::get_from_message_string(read.clone());
if ri.rdid == self.info.id {
println!("for a local user");
self.local_pending_messages.insert(ri.rid, PendingMessage::new(true, self.info.id, read.clone()));
continue;
} else {
for j in 0..self.tcp_distributors.len() {
println!("indexing");
if self.tcp_distributors[j].info.id == ri.rdid {
self.tcp_distributor_write(j, read.clone());
}
Expand Down
2 changes: 1 addition & 1 deletion dlwp/src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ pub fn fmt_message_send(msg: &String) -> String {
#[inline]
pub fn fmt_message_recv(recv: &String) -> String {
let split_first = recv.split(MSG_INIT).collect::<Vec<&str>>();
if split_first.len() != 2 {
if split_first.len() < 2 {
return recv.clone();
}

Expand Down
2 changes: 1 addition & 1 deletion test_streams/test_client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fn main() {
// Add the client/server's ID and the Distributor ID
dlwp::stream::StreamType::Client {
rid: 9711410197108107101,
rdid: 4,
rdid: 3,
port: 5000,
},
false,
Expand Down

0 comments on commit 8341895

Please sign in to comment.