ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/Event/Handle.pm
(Generate patch)

Comparing Coro/Event/Handle.pm (file contents):
Revision 1.9 by root, Mon Sep 24 00:51:19 2001 UTC vs.
Revision 1.10 by root, Mon Sep 24 01:36:21 2001 UTC

16 16
17=cut 17=cut
18 18
19package Coro::Handle; 19package Coro::Handle;
20 20
21no warnings; 21no warnings qw(uninitialized);
22 22
23use Errno (); 23use Errno ();
24use base 'Exporter'; 24use base 'Exporter';
25 25
26$VERSION = 0.45; 26$VERSION = 0.45;
130 130
131Returns the "real" (non-blocking) filehandle. Use this if you want to 131Returns the "real" (non-blocking) filehandle. Use this if you want to
132do operations on the file handle you cannot do using the Coro::Handle 132do operations on the file handle you cannot do using the Coro::Handle
133interface. 133interface.
134 134
135=item $fh->unsysread($data)
136
137Pushes the given data into the input buffer. The following calls to
138read/sysread will first return this data.
139
135=cut 140=cut
136 141
137sub fh { 142sub fh {
138 tied(${$_[0]})->{fh}; 143 (tied ${$_[0]})->[0];
144}
145
146sub unsysread {
147 substr tied(${$_[0]})->[3], 0, 0, $_[1];
139} 148}
140 149
141package Coro::Handle::FH; 150package Coro::Handle::FH;
142 151
143no warnings; 152no warnings qw(uninitialized);
144 153
145use Fcntl (); 154use Fcntl ();
146use Errno (); 155use Errno ();
147use Carp 'croak'; 156use Carp 'croak';
148 157
154# 163#
155# 0 FH 164# 0 FH
156# 1 desc 165# 1 desc
157# 2 timeout 166# 2 timeout
158# 3 rb 167# 3 rb
159# 4 wb 168# 4 wb # unused
160# 5 rw 169# 5 rw
161# 6 ww 170# 6 ww
162 171
163sub TIEHANDLE { 172sub TIEHANDLE {
164 my $class = shift; 173 my $class = shift;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines