Page 8 of 12

Re: Dedicated Server API Client Communication

Posted: 04 May 2014, 18:57
by Jojo_44
I´m running out of ideas ;)

Just to clarify this:

The interrupts occur with the original nadeo library and also with the new one from Big_Boo ?

Maybe echoing out the data variable before returning false would help to get some information ?

Jojo

Re: Dedicated Server API Client Communication

Posted: 04 May 2014, 18:59
by The_Big_Boo
kremsy wrote:

Code: Select all

[ManiaControl DEBUG]: Fatal Exception: Connection interrupted while writing
This is something new. But it also means there's something really wrong, which lower the chances that it comes from my library... so, unfortunately, it likely comes from somewhere else.


However, can you apply this patch so we get more information about the socket state

Code: Select all

diff --git a/libraries/Maniaplanet/DedicatedServer/Xmlrpc/GbxRemote.php b/libraries/Maniaplanet/DedicatedServer/Xmlrpc/GbxRemote.php
index e6deb62..3cc0c44 100644
--- a/libraries/Maniaplanet/DedicatedServer/Xmlrpc/GbxRemote.php
+++ b/libraries/Maniaplanet/DedicatedServer/Xmlrpc/GbxRemote.php
@@ -218,7 +218,7 @@
 	{
 		$header = $this->read(8);
 		if($header === false)
-			throw new TransportException('Connection interrupted while reading header', TransportException::INTERRUPTED);
+			throw new TransportException('Connection interrupted while reading header '.print_r(stream_get_meta_data($this->socket), true), TransportException::INTERRUPTED);
 
 		extract(unpack('Vsize/Vhandle', $header));
 		/** @var $size int */
@@ -231,7 +231,7 @@
 
 		$data = $this->read($size);
 		if($data === false)
-			throw new TransportException('Connection interrupted while reading data', TransportException::INTERRUPTED);
+			throw new TransportException('Connection interrupted while reading data '.print_r(stream_get_meta_data($this->socket), true), TransportException::INTERRUPTED);
 
 		$this->lastNetworkActivity = time();
 		return array($handle, $data);
@@ -245,7 +245,7 @@
 	{
 		$data = pack('V2a*', strlen($xml), ++$this->requestHandle, $xml);
 		if(!$this->write($data))
-			throw new TransportException('Connection interrupted while writing', TransportException::INTERRUPTED);
+			throw new TransportException('Connection interrupted while writing '.print_r(stream_get_meta_data($this->socket), true), TransportException::INTERRUPTED);
 		$this->lastNetworkActivity = time();
 	}
 


Edit: actually, could you also update the dedicated-api library upto at least this commit (the more recent ones concerning the Connection class "refresh")? Because, I quickly checked and saw the version you're using is way behind mine so it doesn't really help finding issues ^^

Edit 2: by any chance, can your interruptions issues be related in any way to your AsynchronousFileReader? I mean, this report strangely shows the same kind of symptoms (timeout, no data received at all) :? I'm not saying this is the cause but it might be interesting to look into this more closely.

Re: Dedicated Server API Client Communication

Posted: 09 May 2014, 13:37
by The_Big_Boo
kremsy wrote:What I don't really understand in the changes is, why you combined chatSend and chatSendServerMessage.
I actually had in mind that only chatSendServerMessage is necessary because making the server "speaking" like any player is weird (and ugly anyway). But using chatSend is shorter than chatSendServerMessage thus I decided to merge it.
I can still:
- make isServerMessage argument default to true (though it breaks a bit compatibility)
- undeprecate chatSendServerMessage while keeping the current chatSend
- undeprecate chatSendServerMessage and remove the isServerMessage argument in chatSend

However, before choosing any of these choices, what exactly is bothering you with this change?

Re: Dedicated Server API Client Communication

Posted: 09 May 2014, 13:46
by steeffeen
kremsy wrote:I just think it can get sometimes weird [...] if the Method names are differing from the official DedicatedServer Method names
this.
imo the dedi-api is an interface to the dedi and not a framework that does additional logic