Minor improvements here and there:
authorRoland Häder <roland@mxchange.org>
Thu, 21 Jul 2011 20:17:38 +0000 (20:17 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 21 Jul 2011 20:17:38 +0000 (20:17 +0000)
- Messages of socket exceptions made more clear
- $protocolInstance can be NULL

inc/classes/exceptions/socket/class_InvalidSocketException.php
inc/classes/exceptions/socket/class_SocketConnectionException.php
inc/classes/exceptions/socket/class_SocketCreationException.php
inc/classes/exceptions/socket/class_SocketOptionException.php
inc/classes/main/class_BaseFrameworkSystem.php
inc/classes/main/container/socket/class_SocketContainer.php

index a6b69c41c5ac0cb2b2ddc0f75d1d116c4247b97e..27ccb5d537e49dcfac101703420e12cc6961387b 100644 (file)
@@ -32,7 +32,7 @@ class InvalidSocketException extends FrameworkException {
         */
        public function __construct (array $messageData, $code) {
                // Construct the message
-               $message = sprintf("[%s:] Invalid socket (type %s != resource). errno=%s, errstr=%s",
+               $message = sprintf("[%s:] Invalid socket, type=%s, errno=%s, errstr=%s",
                        $messageData[0]->__toString(),
                        $messageData[1],
                        $messageData[2],
index 2e53617d57178e879e6d3e8913d38257ba2c0992..c7210108c1598400cdcf32ff7c7987eab2815350 100644 (file)
@@ -33,7 +33,7 @@ class SocketConnectionException extends FrameworkException {
         */
        public function __construct (array $messageData, $code) {
                // Construct the message
-               $message = sprintf("[%s:] Could not make a connection! (type %s != resource). errno=%s, errstr=%s",
+               $message = sprintf("[%s:] Could not make a connection, type=%s, errno=%s, errstr=%s",
                        $messageData[0]->__toString(),
                        $messageData[1],
                        $messageData[2],
index 12155de49f527f4e95d7386a58367287d462e815..d3260a61da095a24b58bcb62814253aeaf133ce2 100644 (file)
@@ -33,7 +33,7 @@ class SocketCreationException extends FrameworkException {
         */
        public function __construct (array $messageData, $code) {
                // Construct the message
-               $message = sprintf("[%s:] Cannot create socket (type %s != resource). errno=%s, errstr=%s",
+               $message = sprintf("[%s:] Cannot create socket, type=%s, errno=%s, errstr=%s",
                        $messageData[0]->__toString(),
                        $messageData[1],
                        $messageData[2],
index c63a0adae10f9e63ae4ce80b67293b42fa8cbf65..a05282773c8797836ec11ce23b59d4bc2a43ec14 100644 (file)
@@ -33,7 +33,7 @@ class SocketOptionException extends FrameworkException {
         */
        public function __construct (array $messageData, $code) {
                // Construct the message
-               $message = sprintf("[%s:] Changing option on socket failed! (type %s != resource). errno=%s, errstr=%s",
+               $message = sprintf("[%s:] Changing option on socket failed, type=%s, errno=%s, errstr=%s",
                        $messageData[0]->__toString(),
                        $messageData[1],
                        $messageData[2],
index 6ac52f82b794b8afbb0fe68fa1e507f053bb6053..731a7251425522cd147c5b57efed00d3cc107447 100644 (file)
@@ -1510,7 +1510,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @param       $protocolInstance       An instance of an ProtocolHandler
         * @return      void
         */
-       public final function setProtocolInstance (ProtocolHandler $protocolInstance) {
+       public final function setProtocolInstance (ProtocolHandler $protocolInstance = NULL) {
                $this->protocolInstance = $protocolInstance;
        }
 
index ea54138775d0f31b0ae04a833d432aee24e33239..8b70b95421ac708e1e77dfa0ce6710056e3fac44 100644 (file)
@@ -40,7 +40,7 @@ class SocketContainer extends BaseContainer implements Registerable {
         * @param       $packageData            Raw package data
         * @return      $containerInstance      An instance of this Container class
         */
-       public static final function createSocketContainer ($socketResource, ProtocolHandler $protocolInstance, array $packageData) {
+       public static final function createSocketContainer ($socketResource, ProtocolHandler $protocolInstance = NULL, array $packageData) {
                // Get a new instance
                $containerInstance = new SocketContainer();