|
Hi,
I have had a little success using Indy
for a small app I am writing but I would like to try something a bit smaller and
port to linux and windows. I believe the way to go is synapse, but I need a
little help getting started. The app I am writing waits for data on a particular
port and processes each line using regex. I also need to know how to set the
port no, bindings and active.
My current code for indy looks like:
code================================================
{****************************************
//start logging port servers *****************************************} idTcpServer1.DefaultPort :=
StrtoInt(liteDB1.Results[0][4]);
idTCPServer1.Bindings.Add.SetPeer(liteDB1.Results[0][5],liteDB1.Results[0][4]); idTcpServer1.Active := True; {*********************************************
Catch and process calls **********************************************} procedure TForm1.IdTCPServer1Execute(AContext:
TIdContext);
var LCmd: string; begin with AContext.Connection.IOHandler do begin EndStr1 := 0; LCmd := ReadLn; Regex1 := TPerlRegEx.Create(nil); Regex1.RegEx := RegExpStr1; Regex1.Subject := LCmd; if EndStr1 = 0 then Begin if Regex1.Match then begin writeLn('system recognised'); richedit1.Lines.Append('system recognised'); if RegExpEnd1 = '1' then EndStr1 := 1; end else begin writeLn('not recognised'); richedit1.Lines.Append('not recognised'); EndStr1 := 0; end; end; if EndStr1 = 1 then begin sysStr1 := sysStr1+LCmd; richedit1.Lines.Append(sysStr1); CallString1 := CallConv(sysStr1,PhonesysID1); richedit1.Lines.Append(CallString1); EndStr1 := 0; SysStr1 := ''; end else begin if RegExpEnd1 <> '1' then SysStr1 := SysStr1+LCmd; end; end;
end ==============================================================
How would I change this to use synapse?
Thanks in advance.
|
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ synalist-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/synalist-public
