Page 3 of 12

Re: Dedicated Server API Client Communication

Posted: 18 Apr 2014, 10:08
by The_Big_Boo
Slig wrote:Mybe initialyse both variables before the unpack(), to avoid warning if the code using your lib have increased the warning verbosity/level ?
It doesn't give any warning neither. You can check it easily: ;)

Code: Select all

error_reporting(E_ALL);
extract(array('foo' => 'bar'));
echo $foo;
kremsy wrote:Now I was able to look into the wireshark packages:
http://www.pictures.esc-clan.net/upload/wirsh.png

It really looks like the dedi doesnt receive the Mehtod call (often retransmission) or it just dont send anything or something, but it's weired I'm pretty sure that the connection is not interrputed.
Hmmm... There isn't any packet sent/received for around 10 minutes so the connection interruption is actually an explanation, though I don't know who could have closed it (the dedicated, your machine or PHP...)

Re: Dedicated Server API Client Communication

Posted: 18 Apr 2014, 16:30
by Slig
kremsy wrote:
Hmmm... There isn't any packet sent/received for around 10 minutes so the connection interruption is actually an explanation, though I don't know who could have closed it (the dedicated, your machine or PHP...
It seems like that is the point, but yeah the question is where that it caused by.
But shouldn't there be a connection in every callback read?
I think that Boo got it. I'm not sure how long it is, but i think that an unused tcp connection will timeout before 10min, either because of the client side, server side, router-nat, etc.
Note that many application which use tcp include a keepalive to avoid connection timeout.

In Fast, if there is no method call or callback recevied last 2 minutes then i do a GetServerName call to keepalive connection, and i never got your issue.

Re: Dedicated Server API Client Communication

Posted: 18 Apr 2014, 18:28
by The_Big_Boo
kremsy wrote:By the way an solution to avoid varnings in the IDEs would be to declare phpdocs
I'm personally always deactivating "unitialized variable" check when working in PHP (because with file inclusions, it's often wrong). Moreover, in Netbeans, even with a phpdoc it'll show them as warnings or errors (as you can choose that in settings). I'll add them though, if it helps for other IDEs.


About the connection issue, I agree implementing some kind of keepalive is the best way to go.


And about the exception, I chose to have a new namespace without thinking it'll break exception catching everywhere :teub: I'll fix that ^^

Edit: fixed, and I added an idle timer so you can easily make a keepalive. You just need to call Connection->getIdleTime()

Re: Dedicated Server API Client Communication

Posted: 18 Apr 2014, 23:45
by TheM
@The_Big_Boo: it seems that changing to your GbxRemote causes some small problems when it comes to special characters in the chat: http://dump.klaversma.eu/ScreenCharacter.jpg.

I was first using the "old" communicator, until you see the weird A in the chat.
You can also see on the left that the nicknames are incorrect.

If you could fix that, it would be amazing! Apart from that: nice work! :thumbsup:

By the way, I have the xmlrpc extension enabled.

Re: Dedicated Server API Client Communication

Posted: 18 Apr 2014, 23:49
by TMarc
This is a typical "language encoding" problem of XML (also seen that in totally different areas).
I guess switching to Unicode would probably solve it.