#!/usr/bin/perl use strict; use warnings; use IO::Socket; use URI; $SIG{CHLD} = 'IGNORE' ; my $server=IO::Socket::INET->new( LocalAddr => shift(@ARGV) || 'localhost', LocalPort => shift(@ARGV) || 2288, Listen => 5, Proto => 'tcp' ); die "ERROR Create Server Socket\n" unless($server); my @data=; chomp(@data); while (my $client = $server->accept()) { binmode($client); print "CONNECT!\n"; unless(fork) { $server->close(); print "SEND\n"; print $client join("\n",@data); $client->close(); exit(); } } ######################################################################## __DATA__ H:IEQ0111347,00b5b6,0102,00000000,3ed09189,01,32 M:00,01,VgICAQpXb2huemltbWVyAQhjAgZLw7xjaGUAjwIFAQEIY0lFUTAxOTI4MDcKV29obnppbW1lcgEEAFv7SUVRMDE1Njg3NwtXb2huZmVuc3RlcgEFAEu4SUVRMDE0NTQ4OQxFQ08tU2NoYWx0ZXIAAQCPAklFUTAxOTU0NzUGS8O8Y2hlAgQAX9ZJRVEwMTU3Nzc2DUZlbnN0ZXJrw7xjaGUCAQ== C:00b5b6,7QC1tgACAf9JRVEwMTExMzQ3AQsABEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsABEAAAAAAAAAAQQAAAAAAAAAAAAAAAAAAAAAAAAAAAGh0A6Ly9zcGFycGFrZXQtaGVpenVuZy5ld2UuZGU6ODAvY3ViZQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAENFVAAACgADEA4AAENFU1QAAwAAIBwAAA== C:005fd6,EQBf1gQAEw9JRVEwMTU3Nzc2 C:008f02,0gCPAgECFP9JRVEwMTk1NDc1Lh49CQcYA3AM/wA8dVycPNVc9j0gPSA9IEUgRSBFIEUgRSBFIDx1XJw8zFztPSA9ID0gRSBFIEUgRSBFIEUgPSA9ID0gPSA9ID0gPSBFIEUgRSBFIEUgRSA9ID0gPSA9ID0gPSA9I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