helma / lazar-core

DEPRECATED (use the pure ruby implementation in conjunction with libfminer in opentox-algorithm and opentox-model), C++ implementation of various lazar algorithms

lazar-core / client.pl
100755 38 lines (29 sloc) 0.71 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/perl
 
# known end of message indicator the server uses
$flag = "~EOT~\n";
 
# create socket
use IO::Socket;
my $sock = new IO::Socket::INET (
    PeerAddr => 'localhost',
    PeerPort => '30000',
    Proto => 'tcp'
);
die "Could not create socket: $!" unless $sock;
 
# send message
#while (<>) {
 
#print "\nSending message to daemon...";
#$msg = "c1ncc(cc1)N(N=O)C";
#print "['"; print $msg; print "'] --> daemon \n\n";
#print $sock $_;
#}
# read reply
#print "Receiving reply from daemon...\n";
 
$response = <$sock>;
while ($response ne "$flag") {
$rep.=$response;
$response = <$sock>;
}
 
 
print "['"; print $rep; print "'] <-- daemon \n\n";
 
#close socket
#print "Closing socket.i\n";
close($sock)