def initialize aStream
@stream = aStream
@sendLock = Mutex.new
@recvLock = Mutex.new
@responses = {}
@tagPool = RangedPool.new(0...BYTE2_MASK)
@fidPool = RangedPool.new(0...BYTE4_MASK)
@msize = Tversion::MSIZE
req = Tversion.new(
:tag => Fcall::NOTAG,
:msize => Tversion::MSIZE,
:version => Tversion::VERSION
)
rsp = talk(req)
unless req.version == rsp.version
raise Error, "protocol mismatch: self=#{req.version.inspect} server=#{rsp.version.inspect}"
end
@msize = rsp.msize
@authFid = Fcall::NOFID
@rootFid = @fidPool.obtain
attach @rootFid, @authFid
end