ik heb nu het volgende
hij wil op een of andere manier niet doorgaan met msn_notification_connect()
ik heb hem ook even anders in elkaar gezet in een functie maar dan krijg ik een time out
zoals ie nu dus is werkt ie wel maar hij gaat niet verder met de functie msn_notification_connect()
PHP:
1
| <?class MSN_Messenger { var $msn_host = "messenger.hotmail.com"; var $msn_port = 1863; var $msn_proto = 'MSNP2'; var $usr_email = ".............@hotmail.com"; var $usr_password = "password"; var $enc = "MD5"; var $trid = 0; var $connected = false; var $socket; var $not_serv; var $not_port; function MSN_Messenger() { $this->msn_connect(); } function msn_connect() { if ($this->socket = fsockopen($this->msn_host, $this->msn_port)) { $this->connected = true; // send the version that's supported to the server $this->msn_send('VER ' . $this->trid . ' ' . $this->msn_proto); if (eregi('^VER ', $this->msn_recv())) { echo "\n\nSuccessfully communicated to " . $this->msn_host . ".<BR>"; } // send a request to the server asking it for the name of the security package it supports for authentication $this->msn_send('INF ' . $this->trid++); if (eregi('^INF ', $this->msn_recv())) { echo "We got the encryption package.<BR>"; } // send the userid to the server $this->msn_send('USR ' . $this->trid++ . ' ' . $this->enc . ' I ' . $this->usr_email); if (eregi('^XFR ', $this->msn_recv())) { echo "User Passport information sent, awaiting transfer.<BR>"; @list($cmd, $trid, $type, $info, $etc) = explode(' ', $inbound); $info = trim($info); echo "Transfer server receved: " . $info . "<BR>"; @list($server, $port) = explode(':', $info); $this->not_serv = $server; $this->not_port = $port; echo "Closing connection for transfer server.<BR>"; $this->connected = false; $this->msn_notification_connect(); } } } function msn_notification_connect() { if (!$this->connected) { if ($this->socket = fsockopen($this->not_serv, $this->not_port)) { $this->connected = true; $this->msn_send('VER ' . $this->trid . ' ' . $this->msn_proto); if (eregi('^VER ', $this->msn_recv())) { echo "\n\nSucessfully communicated to " . $this->not_serv . "<BR>"; } $this->msn_send('INF ' . $this->trid++); if (eregi('^INF ', $this->msn_recv())) { echo "We got the encryption package.<BR>"; } $this->msn_send('USR ' . $this->trid++ . ' ' . $this->enc . ' I ' . $this->user); $inbound = $this->msn_recv(); if (eregi('^USR ', $inbound)) { @list($cmd, $trid, $enc, $mode, $digest) = explode(' ', $inbound); if (trim($mode) == 'S') { echo "Encryption mode recv'd...<BR>"; $encpass = md5(trim($digest) . $this->_pass); $this->msn_send('USR ' . $this->trid++ . ' MD5 S ' . $encpass); echo "Encryped user password sent: " . $encpass . "<BR>"; } } $final = $this->msn_recv(); if (eregi('^USR ', $final)) { @list($cmd, $trid, $stat, $usr, $sn, $etc) = explode(' ', $final); if (trim($stat) == 'OK') { echo "Server replied OK to signon.<BR>"; echo "USER: $etc?<BR>"; $this->msn_send('CHG ' . $this->trid++ . ' NLN'); $this->msn_send('BLP ' . $this->trid++ . ' AL'); $this->msn_send('REA ' . $this->trid++ . ' ' . $this->user . ' ' . urlencode($this->user_real)); } } $ring = $this->msn_recv(); if (eregi('^RNG ', $ring)) { // hier verder gaan } } } } function msn_send($data) { if ($this->connected) { return fputs($this->socket, $data . "\r\n"); } } function msn_recv() { if ($this->connected) { return fgets($this->socket, 2048); } }}$msn = new MSN_Messenger;while($msn->connected){ echo $msn->msn_recv();}?> |
hij wil op een of andere manier niet doorgaan met msn_notification_connect()
ik heb hem ook even anders in elkaar gezet in een functie maar dan krijg ik een time out
zoals ie nu dus is werkt ie wel maar hij gaat niet verder met de functie msn_notification_connect()
PSN jschut_82 | Xbox: JSchut82