projects
/
Biblio-RFID.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
retry sip response
[Biblio-RFID.git]
/
scripts
/
RFID-JSONP-server.pl
diff --git
a/scripts/RFID-JSONP-server.pl
b/scripts/RFID-JSONP-server.pl
index
4bec23e
..
3e1d4fd
100755
(executable)
--- a/
scripts/RFID-JSONP-server.pl
+++ b/
scripts/RFID-JSONP-server.pl
@@
-92,14
+92,18
@@
sub sip2_message {
my $expect = substr($send,0,2) | 0x01;
my $expect = substr($send,0,2) | 0x01;
- my $in = <$sock>;
- $in =~ s/^\n//;
- warn "SIP2 <<<< ",dump($in), "\n";
+ my $in = '';
+ my $repeat = 1;
+ while ( $in eq '' && $repeat < 10 ) {
+ $in = <$sock>;
+ $in =~ s/^\n//;
+ $in =~ s/\r$//;
+ warn "SIP2 <<<< ",dump($in), " repeat: $repeat\n";
+ $repeat++;
+ }
die "expected $expect" unless substr($in,0,2) != $expect;
die "expected $expect" unless substr($in,0,2) != $expect;
- $in =~ s/\r$//;
-
my $hash;
if ( $in =~ s/^([0-9\s]+)// ) {
$hash->{fixed} = $1;
my $hash;
if ( $in =~ s/^([0-9\s]+)// ) {
$hash->{fixed} = $1;