Use TWSocket component to connect to the server using same parameters
(127.0.0.1/TCP/1099). Then send the data in the same format, then grab the
response (using OnDataAvailable event and Receive method) then gracefully
close the socket (Shutdown).

Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be


----- Original Message ----- 
From: "A Drent" <[EMAIL PROTECTED]>
To: <twsocket@elists.org>
Sent: Thursday, September 13, 2007 10:11 AM
Subject: [twsocket] Converting some perl to Delphi using sockets


> Hi,
>
> We use a small perl script to exchange data between a webserver and an
> application server. I was looking to change this to Delphi. Can someone
give
> a hint how to do this the best way using the ICS components?
>
> Best regards, Albert Drent
> university of Groningen
>
> use IO::Socket;
> #
> # To let this script work, please replace the PeerAddr by the
> # correct application server ip address (default 'localhost') and replace
> # the PeerPort by the correct application server port
> #
> $envString=GetEnvVariables();
> $remote=IO::Socket::INET->new(Proto=>"tcp", PeerAddr=>'127.0.0.1',
> PeerPort=>'1099') or ShowError("[1099] Can't connect to server");
> $remote->autoflush(1);
> binmode($remote);
> #
> # Send data to the application server
> #
> print $remote $envString;
> #
> # Retrieve data from the application server and send it back to
> # the web-server
> #
> binmode($remote);
> binmode(STDOUT);
> while(<$remote>){join print;
> }
> #
> # ok... all done!
> #
> close($remote);
> #
> # e n d   o f   p r o g r a m
> #
> #
>
>
> -- 
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://www.elists.org/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to