Hi --
I am testing perl scripts to send/receive. The receiver runs on linux. I have an identical sender script that I invoke either on the same linux box, or on a windows XP box. If the file I'm sending contains a long-ish block of text (more than about 2K), the linux -> linux transfer seems fine, but the windows -> linux transfer ends up short. If I examine the two files received on the linux side, I see that the windows file has had a few characters snipped at about byte 1258, and a $0A$ put in their place.
For example:
linux snippet: the free ($20746865206672656520$) hex
windows snippet: the
e ($20746865200A6520$) hex
In the windows file, the first three characters of the word "free" have been replaced by $0A$. How can I prevent this from happening??
Thanks in advance to anyone who can help!!
p.s. Here is the sender script:
******************************************************
# sender
# a simple client using IO:Socket
#----------------
use strict;
use IO::Socket;
my $infile = @ARGV[0];
my $sock;
my $HL7 = <>;
my $wbytes;
my $rbytes = 5120;
my $ackback = "no ack received.";
open LOGFILE, ">>hl7.log";
my $sock = new IO::Socket::INET (PeerAddr => '192.168.1.210', PeerPort => 10500, Proto => 'tcp');
$sock or die "no socket :$!";
#print "socket created...\n";
$wbytes = send ($sock, "\013".$HL7."\034\015", 0);
print "$wbytes sent.\n";
recv ($sock, $ackback, $rbytes, 0);
print LOGFILE ("File sent: " . $infile . ".\n");
print LOGFILE ("Bytes sent: " . $wbytes . ".\n");
print LOGFILE ("Received ack: " . $ackback . ".\n");
close LOGFILE;
close ($sock);
I am testing perl scripts to send/receive. The receiver runs on linux. I have an identical sender script that I invoke either on the same linux box, or on a windows XP box. If the file I'm sending contains a long-ish block of text (more than about 2K), the linux -> linux transfer seems fine, but the windows -> linux transfer ends up short. If I examine the two files received on the linux side, I see that the windows file has had a few characters snipped at about byte 1258, and a $0A$ put in their place.
For example:
linux snippet: the free ($20746865206672656520$) hex
windows snippet: the
e ($20746865200A6520$) hex
In the windows file, the first three characters of the word "free" have been replaced by $0A$. How can I prevent this from happening??
Thanks in advance to anyone who can help!!
p.s. Here is the sender script:
******************************************************
# sender
# a simple client using IO:Socket
#----------------
use strict;
use IO::Socket;
my $infile = @ARGV[0];
my $sock;
my $HL7 = <>;
my $wbytes;
my $rbytes = 5120;
my $ackback = "no ack received.";
open LOGFILE, ">>hl7.log";
my $sock = new IO::Socket::INET (PeerAddr => '192.168.1.210', PeerPort => 10500, Proto => 'tcp');
$sock or die "no socket :$!";
#print "socket created...\n";
$wbytes = send ($sock, "\013".$HL7."\034\015", 0);
print "$wbytes sent.\n";
recv ($sock, $ackback, $rbytes, 0);
print LOGFILE ("File sent: " . $infile . ".\n");
print LOGFILE ("Bytes sent: " . $wbytes . ".\n");
print LOGFILE ("Received ack: " . $ackback . ".\n");
close LOGFILE;
close ($sock);