Thanks for the link but that's not exactly what I was looking for. I want to use a socket made in Perl to suck tick data from MB Trading.
I found this code which the author said should work for the RECDESC record but I don't seem to get any response back. I called MB Trading and they verified the IP and port are correct. First I'd just like to make sure I can connect properly.
Any ideas?
#!/usr/bin/perl
use IO::Socket::INET;
sub OpenSocket
{
my $name = '64.93.81.10';
my $port = 5020;
$socket = IO::Socket::INET->new('PeerAddr' => $name,
'PeerPort' => $port,
'Proto' => 'tcp')
or die "Can't create socket ($!)\n";
}
sub Send
{
my $data = $_[0];
my $terminator=pack("h2", "FF");
print $socket $data;
print $socket $terminator;
}
OpenSocket();
Send('<RECDESC><ReqType>SNAP</ReqType></RECDESC>');
while (defined($_ = $socket->getline)) {print;}
close $socket;
exit;