* matching socket resource for that protocol.
*
* @param $packageData Raw package data array
+ * @param $connectionType Type of connection, can be 'incoming' or 'outgoing', *NEVER* 'server'!
* @return $socketResource A valid socket resource or FALSE if an error occured
* @throws NoListGroupException If the procol group is not found in peer list
* @throws NullPointerException If listenerInstance is NULL
*/
- public function discoverSocket (array $packageData) {
+ public function discoverSocket (array $packageData, $connectionType) {
+ // Assert on type
+ assert($connectionType != BaseConnectionHelper::CONNECTION_TYPE_SERVER);
+
// Determine protocol name
$protocolName = $this->determineProtocolByPackageData($packageData);
* instance and pass over the whole package data to get the right
* socket.
*/
- $socketResource = $listenerInstance->getPoolInstance()->getSocketFromPackageData($packageData);
+ $socketResource = $listenerInstance->getPoolInstance()->getSocketFromPackageData($packageData, $connectionType);
// Debug message
if (is_resource($socketResource)) {