xmppo / xmpp-php

PHP client library for XMPP (Jabber) protocol
https://github.com/xmppo/xmpp-php
MIT License
45 stars 23 forks source link

Ability to change socket stream timeout #20

Open matthewknill opened 1 year ago

matthewknill commented 1 year ago

We are using this library to set presence on for a number of users on our XMPP server. This seems to work well but the it takes a long time to actually set. After some looking around, I found this to be caused by the following in the Socket class:

protected $timeout = 150000; // changing to 1500 significantly reduced the time taken to set all the presence
// ...
stream_set_timeout($this->connection, 0, $this->timeout);

Unfortunately, it does not seem that I can change this via the Options class.

matthewknill commented 1 year ago

Needed this ability so I've made a fork (matthewknill/xmpp-php) and added setSocketTimeout to the Options class

Norgul commented 1 year ago

Hello @matthewknill I'm pressed for the time lately, but feel free to make a PR, I'll gladly merge it in

4i-helpynet commented 1 year ago

Hello. Not strictly related querstion, sorry about my courage to ask in an active thread here: I want to create a connection attaching to an outher client with give the SID, RID, JID combo. How can I get a current connection datas of a client?