im creating a website which uses php to connect to an XMPP server , and send a message However, im having a problem with sending/receiving messages .. Question is do i have to reconnect and send username/password everytime i make a request ( send a message ) ? how to avoid reconnecting ?
This is how i connect :
$this->_socket = fsockopen("sever.tld", 5222, $errno, $errstr, 30);
i send messages using fwrite Like this :
fwrite($Socket, $data);
i read messages using fread Like this :
$response = @fread($this->_socket, 1024);