Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 9c7b581

Browse files
#Added some check to only return data if not empty
1 parent 0a0ba05 commit 9c7b581

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

‎PrinceSocket.Class.php‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<?php
22
defined('PRINCE_SOCKET')or die('no direct connect');
3+
/*
4+
Desc: Socket Programming Class that can connect to any TCP/IP, UDP host and port, or any socket application interface.
5+
Author: Prince Ademola Adeyemi
6+
Contact: YourVegasPrince@gmail.com
7+
FB: facebook.com/YourVegasPrince@gmail
8+
*/
39

410
if( !class_exists( 'PrinceSocket' ) )
511
{
@@ -100,10 +106,12 @@ public function _readLine()
100106

101107
if( strlen( $line >= 2 && substr( $line, -2 ) == "\r\n" || substr( $line, -1 ) == "\n" ) )
102108
{
103-
return rtrim( $line );
109+
$line = rtrim( $line );
110+
}
111+
if( !empty( $line ) )
112+
{
113+
return $line;
104114
}
105-
106-
return $line;
107115
}
108116
}
109117

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /