5 main = getArgs >>= \ [user,host] ->
6 let username = (user ++ "@" ++ host) in
7 openFile username ReadWriteMode >>= \ cd ->
8 hSetBuffering stdin NoBuffering >>
9 hSetBuffering stdout NoBuffering >>
10 hSetBuffering cd NoBuffering >>
11 hPutStr cd speakString >>
14 speakString = "Someone wants to speak with you\n"
17 (hReady cd >>= \ ready ->
18 if ready then (hGetChar cd >>= putChar)
21 hReady stdin >>= \ ready ->
22 if ready then (getChar >>= hPutChar cd)