From 0e55dddae82c83e281c6858a892c8d1b41a6a2ac Mon Sep 17 00:00:00 2001 From: xPaw Date: Mon, 27 Apr 2015 22:42:32 +0300 Subject: [PATCH] Abstract away Socket.Read --- SourceQuery/Socket.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/SourceQuery/Socket.class.php b/SourceQuery/Socket.class.php index 7cb361a..41bb7a5 100644 --- a/SourceQuery/Socket.class.php +++ b/SourceQuery/Socket.class.php @@ -70,7 +70,12 @@ public function Read( $Length = 1400 ) { - $this->Buffer->Set( FRead( $this->Socket, $Length ) ); + $this->ReadBuffer( FRead( $this->Socket, $Length ), $Length ); + } + + protected function ReadBuffer( $Buffer, $Length ) + { + $this->Buffer->Set( $Buffer ); if( $this->Buffer->Remaining( ) === 0 ) {