Roland Häder [Tue, 30 May 2017 09:48:06 +0000 (11:48 +0200)]
Continued:
- start rewriting writing raw data to socket towards StorableSocket
- added more debug messages
- renamed class constants to naming-convention
- rewrote more code to StorableSocket (method writeBufferToSocketByArray() introduced)
- added missing parameter $className
- getConnectionClassNameFromSocket() is now fully rewritten
Roland Häder [Mon, 29 May 2017 20:52:35 +0000 (22:52 +0200)]
Continued:
- implemented translateLastSocketErrorCodeToName()
- implemented getSocketRecipient<Address|Port>()
- no more socketResource here (and elsewhere will follow)
- updated core framework
- more debug messages added
- registering helper/listener instances with socket instance must be done
outaside constructor, much easier code
- for this, registerInfoInstance() is now implemented Signed-off-by: Roland Häder <roland@mxchange.org> Signed-off-by: Roland Häder <roland@mxchange.org>
Roland Häder [Mon, 29 May 2017 19:22:54 +0000 (21:22 +0200)]
Continued:
- method renamed to getConnectionClassNameFromSocket() which now only accepts a StorableSocket class
- resolveStateByPackage() now accepts StorableSocket instead of socket resource
- also extend HubInterface
- introduced BaseHubHandler to implement HubInterface (or what is missing + protected setter/getter)
- introduced BaseHubDatabaseWrapper to implement HubInterface
- more debug messages
- other stuff improved
- imported (Base|Peer)StateResolver
- imported StorableSocket
- imported (Lookupable)PeerState
- imported PeerStateable
- created new namespaces
- moved classes around
Roland Häder [Mon, 29 May 2017 15:59:14 +0000 (17:59 +0200)]
Continued:
- imported HelpableNode
- imported SocketDiscoveryFactory, DiscoverableSocket
- imported ProtocolHandlerFactory
- imported BaseProtocolHandler and made it abstract
- imported BaseIpV4ProtocolHandler and it needs to be abstract
- need to implement setter/getter for protocolName
- added missing namespaces to configuration entries
Roland Häder [Mon, 29 May 2017 15:56:08 +0000 (17:56 +0200)]
More rewrites:
- rewrote more parts towards SocketContainer/StorableStocket class/interface
- still UdpListener is half-finished
- added missing namespace
- imported BaseNodeHelper
Roland Häder [Wed, 24 May 2017 20:04:07 +0000 (22:04 +0200)]
Prepared next step of socket-rewrites:
- instead of direct socket resource, use socket instance (not working now,
die() has been added, too)
- updated core framework
Roland Häder [Mon, 22 May 2017 20:47:55 +0000 (22:47 +0200)]
Continued:
- imported PackageDiscoveryFactory, BaseRecipientDiscovery, DiscoverableRecipient
- imported DiscoverableNodeRecipient, RecipientListFactory, (Base)Recipient
- imported ObjectFactory (opps?)
- imported InvalidSessionIdException (also where it is being caught!)
- imported FrameworkException
- imported BaseIterator
- recipients and not receipt! ;-)
- also they are network-relevant and not generic
- added namespaces to configuration entries
Roland Häder [Mon, 22 May 2017 18:42:34 +0000 (20:42 +0200)]
Continued:
- no more 'base_path', was to unflexible and horribly wrong. Now there are 3
configuration entries:
'root_base_path' - Where index.php has been found
'framework_base_path' - Where the framework is located
'application_base_path' - Where the applications are located (without application name)
- imported FileNotFoundException
- imported DhtObjectFactory
- updated core framework
Roland Häder [Mon, 22 May 2017 17:05:37 +0000 (19:05 +0200)]
Continued:
- imported Distributable
- imported FiLoStacker
- imported BaseState
- imported NodeDistributedHashTableDatabaseWrapper
- created/added namespaces
- setter/getter for DHT instance is no longer working and maybe okay to use
DhtObjectFactory instead. Okay, a few more calls then, but well.
- renamed HubPingIterator -> NodePingIterator
- updated core framework
Roland Häder [Mon, 22 May 2017 16:39:19 +0000 (18:39 +0200)]
Continued:
- ListenerVisitor is not generic (Listenable), re-imported it
- this task is also no longer generic
- added missing namespaces
- imported BaseTask
- imported ChunkHandler(Factory), BaseHandler
- imported PackageFragmenter
- changed namespace
Roland Häder [Mon, 22 May 2017 16:23:17 +0000 (18:23 +0200)]
Cleanup:
- isServerSocketResource() was at the start a good idea, to make sure that only
"server" (listeners) sockets can pass but it was hindering it when it comes
to UDP where there is no connection.
- so let's better remove this method all together
- updated TODOs.txt
Roland Häder [Mon, 22 May 2017 13:25:37 +0000 (15:25 +0200)]
Continued a bit:
- implemented enableSocketReuseAddress()
- imported (Base)Iterator
- added missing namespaces
- created new namespaces (also template)
- cleared up now obsolete code as StorableSocket is now there
- renamed method to listenToSocket()
Roland Häder [Sun, 21 May 2017 21:26:22 +0000 (23:26 +0200)]
Continued:
- Socket protocol names being used are now "abstracted" into constants (interface)
- no need to get last socket error code and then use it only once (per method)
- handle over only array values of packageData array to socket-error handler
- used these new constants more
Roland Häder [Sun, 21 May 2017 20:51:32 +0000 (22:51 +0200)]
Continued rewrite:
- rewrote TcpListener (should be working, untested) towards SocketFactory
- added missing but needed methods in BaseListenerDecorator which extends
BaseDecorator which is framework (generic)
- renamed method to enableSocketReuseAddress() to make it similar to existings
- added missing namespaces
Roland Häder [Sun, 21 May 2017 20:25:26 +0000 (22:25 +0200)]
Continued:
- setter/getter for socket instance is now in BaseListener
- imported StorableSocket
- moved constants to Poolable interface
- updated core framework
Roland Häder [Sun, 21 May 2017 12:39:43 +0000 (14:39 +0200)]
Continued a bit:
- translateSocketErrorCodeToName() is now private, no need to have it publicly
available
- added field socketProtocol
- used StorableSocket (interface) as 'instanceof' test, not a class
- sorted parameters in SocketContainer's factory method
- sorted members
Roland Häder [Sun, 21 May 2017 11:37:33 +0000 (13:37 +0200)]
WIP:
- rewrite from unlData -> unlInstance (still open things)
- moved constants from class to interface LocateableNode
- moved UNL_REGEX to same interface for rewrite of those parse methods. They
should be moved to a factory instead.
Roland Häder [Sat, 20 May 2017 23:29:11 +0000 (01:29 +0200)]
Continued a bit:
- implemented visitSocket()
- that socket_shutdown() stuff needs rewriting but is now at the right place
- added/removed import of StorabelSocket
Roland Häder [Sat, 20 May 2017 23:10:38 +0000 (01:10 +0200)]
More rewrites:
- imported missing classes/interfaces
- socket error 95 (operation not supported) is now handled and new exception thrown
- EXCEPTION_INVALID_SOCKET is no longer located in BaseListener
- updated core framework
Roland Häder [Sat, 20 May 2017 20:28:46 +0000 (22:28 +0200)]
Continued:
- Per definition, filters are classes. So let's add _class into their
configuration keys to have the later testing suite easily pick them up
for testing.
- implemented enableSocketNonBlocking()
- imported InvalidServerSocketException
- let's get peerAddress (old: peerName) and peerPort via call-by-reference and
as all the other socket methods result as returned value
- always initialize variables, before using them ...
Roland Häder [Sat, 20 May 2017 20:23:24 +0000 (22:23 +0200)]
Continued rewriting:
- handleSocketError() and all it's brothers and sisters (means call-back methods)
are now residing in SocketContainer
- still more rewrites for existing old parts
- renamed factory method to createListenFileSocket() as this creates a
listening file socket (mostly for IPC)
Roland Häder [Sat, 20 May 2017 19:47:20 +0000 (21:47 +0200)]
Continued:
- imported HandleableProtocol
- imported Registerable (only templates)
- created some namespaces
- the "new" exception is coming back from 'core' as it is not generic
- updated core
Roland Häder [Sat, 20 May 2017 18:58:26 +0000 (20:58 +0200)]
Continued:
- Let's use (and cache) the UNL instance instead of fetching an array from it
and then taking parts out of it. This way is more OOP-ed
- added getExternalUnl() and getInternalUnl() as first methods
- getUnlData() is now no longer used, see first comment why
- renamed path 'unl' -> 'locator' to have it same as in interfaces
- updated target year
- updated core framework
Roland Häder [Fri, 19 May 2017 22:24:38 +0000 (00:24 +0200)]
Continued with rewrites:
- introduced HubInterface which holds all public methods from BaseHubSystem
- added HttpClient stuff (unfinished) from core project as this is no longer
generic
- other stuff
Roland Häder [Fri, 19 May 2017 22:11:13 +0000 (00:11 +0200)]
Next wave of rewrite:
- rewrote addPeer() signature to StorableSocket
- removed logging of calling method/line, will be done later otherwise
- some logging added
- implemented isValidSocket()
Roland Häder [Fri, 19 May 2017 15:46:40 +0000 (17:46 +0200)]
Next wave:
- imported BaseList, Listable
- imported BaseHubSystemHelper, BaseConnectionHelper
- created namespaces
- added namespaces to configuration entries
- accept() must be public now
- doShutdown() is old name, now there is preShutdown()
- opps, "unexpted list", let's use Lists like the framework then
Roland Häder [Fri, 19 May 2017 14:37:08 +0000 (16:37 +0200)]
Next wave:
- imported BaseDiscovery, Discoveryable, BaseNodeDiscovery
- created namespaces
- removed duplicate interface, now in core framework
- BaseNodeDiscovery needs to be abstract now
- added missing namespaces
- no, no. BaseNodeDiscovery must implement the generic methods
- tpzo fixed
Roland Häder [Fri, 19 May 2017 14:35:29 +0000 (16:35 +0200)]
Next wave of rewrites:
- now request/response is provided by FrameworkBootstrap and no longer needs
to be handled all over again to all places
- updated core framework
Roland Haeder [Tue, 22 Dec 2015 20:45:48 +0000 (21:45 +0100)]
In case of non-blocking connections (and that is for 99.9999% the case here)
the "error" "operation in progress" is no error and needs to be cleared in
PHP's socket facility + also treated by this code as okay.
Signed-off-by: Roland Haeder <roland@mxchange.org>