1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-04-30 14:34:09 +02:00

Tweak DuplexPipe to set key instead of data when separator is missing

This commit is contained in:
chylex 2017-08-13 17:31:58 +02:00
parent ec5d503e4d
commit d4ecfcceec

View File

@ -46,8 +46,8 @@ private void ReaderThread(){
} }
} }
public void Write(string data){ public void Write(string key){
writerStream.WriteLine(data); writerStream.WriteLine(key);
writerStream.Flush(); writerStream.Flush();
} }
@ -95,8 +95,8 @@ internal PipeReadEventArgs(string line){
int separatorIndex = line.IndexOf(Separator, StringComparison.Ordinal); int separatorIndex = line.IndexOf(Separator, StringComparison.Ordinal);
if (separatorIndex == -1){ if (separatorIndex == -1){
Key = string.Empty; Key = line;
Data = line; Data = string.Empty;
} }
else{ else{
Key = line.Substring(0, separatorIndex); Key = line.Substring(0, separatorIndex);