handle.d (239B)
1 import std.stdio; 2 3 void main(){ 4 foreach(l; stdin.byLine()){ 5 if(l == "CONNECTED"){ 6 writeln("PLAY message.wav"); 7 stdout.flush(); 8 } 9 else if(l == "STOPPED message.wav"){ 10 writeln("HANGUP"); 11 stdout.flush(); 12 break; 13 } 14 } 15 }