module tcpiptest import StdEnv import StdIO import StdMaybe import TCPIP hostIP = "127.0.0.1" hostPort = 1203 :: *Val = String :: *State :== PSt Val handleComs con st = (con``, st``) where (con`, st`) = send "Hello World!\n" con st (con``, st``) = send "More text here!\n" con` st` Start world = case to of TR_Success = handleComs (toStringSChannel con.sChannel) st` _ = abort "CONNECTION ERROR" where (Just adr, st) = lookupIPAddress hostIP world (to, mcon, st`) = connectTCP_MT Nothing (adr,hostPort) st (Just con) = mcon