Changeset 10756
- Timestamp:
- 02/12/10 20:26:50 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Padre-Plugin-Swarm/lib/Padre/Plugin/Swarm/Transport/Global/WxSocket.pm
r10755 r10756 152 152 my $marshal = $self->marshal; 153 153 154 my @messages;155 154 my $data = ''; 155 my $buffer; 156 156 # Read chunks of data from the socket until there is 157 157 # no more to read, feeding it into the decoder. 158 158 # TODO - can we yield to WxIdle in here? .. safely? 159 while ( $sock->Read( $data, 1024, length($data) ) ) { 160 my @m = eval { $marshal->incr_parse($data) }; 161 if ($@) { 159 while ( $sock->Read( $data, 1024, 0 ) ) { 160 $buffer .= $data; 161 $data=''; 162 } 163 eval { $marshal->incr_parse($buffer) }; # VOID context pls!! 164 TRACE( "Pumped $buffer from socket" ) if DEBUG; 165 my @messages; 166 push @messages , eval { $marshal->incr_parse() }; 167 if ($@) { 162 168 TRACE( "Unparsable message - $@" ) if DEBUG; 163 $marshal->incr_skip; 164 } else { 165 push @messages ,@m if @m; 166 } 167 $data=''; 169 #$marshal->incr_skip; 168 170 } 169 171
Note: See TracChangeset
for help on using the changeset viewer.
