[TASK] Added function for clients, so they're able to send initial data right after connecting to a server.

[TASK] Restructured parts of the core to support sending data right after connecting.
[TASK] Adapted core part for automatic reconnect to support sending initial data, too.
This commit is contained in:
Jan Philipp Timme
2011-06-25 22:13:53 +00:00
parent 4c9f5ba7f3
commit 2c5e520c9f
11 changed files with 159 additions and 66 deletions
+4 -1
View File
@@ -207,7 +207,10 @@ class Connection_ConnectionHandler {
* @return boolean
*/
public function writeFromBuffer() {
$result = $this->socketHandler->write($this->buffer_outgoing->getAllBufferContents());
$bufferContent = $this->buffer_outgoing->getAllBufferContents();
//this might not be cool, but it should do.
if($bufferContent === "") return TRUE;
$result = $this->socketHandler->write($bufferContent);
if($result === FALSE) {
$this->shutdown();
return FALSE;