 			
 			// got some data
 			if remaining - readCount == 0 { // done
-				completion(completeArray(from: int, count: read + readCount))
+				completion(completeArray(from: buffer, count: read + readCount))
 			} else { // try again for more
-				readBytesFully(into: int, read: read + readCount, remaining: remaining - readCount, timeoutSeconds: timeoutSeconds, completion: completion)
+				readBytesFully(into: buffer, read: read + readCount, remaining: remaining - readCount, timeoutSeconds: timeoutSeconds, completion: completion)
 			}
 		}
 	}

	public func readSomeBytes(count cnt: Int, completion: ([UInt8]?) -> ()) {
		
		let ptr = ReferenceBuffer(size: cnt)
		let readCount = recv(into: ptr.b, count: cnt)
		if readCount == 0 {
			completion(nil)
		} else if self.isEAgain(err: readCount) {

	#endif
	
	private func completeArray(from frm: ReferenceBuffer, count: Int) -> [UInt8] {
		frm.a.removeLast(frm.size - count)
		return frm.a
	}
	
	func readBytesFully(into buffer: ReferenceBuffer, read: Int, remaining: Int, timeoutSeconds: Double, completion: ([UInt8]?) -> ()) {
		let readCount = recv(into: buffer[read], count: remaining)
		if readCount == 0 {
			completion(nil) // disconnect
		} else if self.isEAgain(err: readCount) {
			
			// no data available. wait
			self.readBytesFullyIncomplete(into: buffer, read: read, remaining: remaining, timeoutSeconds: timeoutSeconds, completion: completion)
			
		} else if readCount < 0 {
			completion(nil) // networking or other error
