#pragma library( "ascom10.lib" ) PROCEDURE MAIN LOCAL o,x,buf := "" o := CreateObject( "MSWinsock.Winsock" ) o := o:dynamicCast( "ActiveXObject" ) o:DataArrival := {|nBytes|_dataArrival(nBytes,o)} o:Connect := {||_Connect(o)} o:RemoteHost := o:localIP o:RemotePort := 1007 o:protocol := 0 o:Connect() ? ? "Press ESC to terminate." while .t. if (x := inkey(0.01)) == 27 ; exit ; endif if x != 0 buf += chr(x) ?? chr(x) if o:state == 7 o:sendData(buf) buf := "" endif endif enddo o:close() RETURN function print(cDsc,xVal) ? cDsc ?? xVal return nil function _dataArrival(nBytes,o) local i,s := s := space(nBytes) o:getData(@s) ?? s return nil function _Connect(o) ? "Connected..." ? return nil