用户操作
[留言]  [发消息]  [加为好友] 
订阅我的博客
XML聚合    FeedSky
订阅到鲜果
订阅到Google
订阅到抓虾
fanccYang的公告
<div class="News"> <EMBED SRC="http://bbs.smgbb.cn/Skins/Default/clock.swf " WIDTH=150 HEIGHT=150 wmode=transparent quality=high loop=true menu=false> 个人简介</br> CSDN: fanccYang</br> MSN: fanccyang@hotmail.com</br> Email: fanccyang@gmail.com</br></br> ------------------------------</br> <p align=left>Sink or Swim!</br> <p align=right>Just do it!</br> ------------------------------</br> </div> <DIV id=Layer1 style="Z-INDEX: 0; LEFT: 180px; WIDTH: 580px; POSITION: absolute; TOP: 1px; HEIGHT: 100%"> <OBJECT codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 height=400 width=400 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000> <PARAM NAME="movie" VALUE="http://bbs.leadbbs.com/images/upload/2003/10/03/160034.swf"><PARAM NAME="quality" VALUE="high"><PARAM NAME="menu" VALUE="false"><PARAM NAME="wmode" VALUE="transparent"> <embed src="http://bbs.leadbbs.com/images/upload/2003/10/03/160034.swf" width="100%" height="100%" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer";;;; type="application/x-shockwave-flash" menu="false" wmode="transparent"></embed></OBJECT></DIV>
文章分类
MSN Research
Hypothetic(RSS)
MSN Document(RSS)
MSNBlog(RSS)
Siebe's Blog(RSS)
Zoronax(RSS)
存档

原创  MSN P2P 协议实现 msmp2p.h 收藏

/*
    msnp2p.h - msn p2p protocol

    Copyright (c) 2003 by Olivier Goffart        <ogoffart@tiscalinet.be>

    *************************************************************************
    *                                                                       *
    * This program is free software; you can redistribute it and/or modify  *
    * it under the terms of the GNU General Public License as published by  *
    * the Free Software Foundation; either version 2 of the License, or     *
    * (at your option) any later version.                                   *
    *                                                                       *
    *************************************************************************
*/

#ifndef MSNP2P_H
#define MSNP2P_H

#include <qobject.h>
#include <qstrlist.h>


class KopeteTransfer;
struct KopeteFileTransferInfo;

class KTempFile;
class QFile;

/**
 * @author Olivier Goffart
 *
 * This class help the MSNSwithboardSocket to handle the MSN-P2P messages
 */
class MSNP2P : public QObject
{
 Q_OBJECT

public:
 MSNP2P(  QObject *parent=0L , const char *name=0L);
 ~MSNP2P();

public slots:
 /**
  * parse an incoming message
  */
 void slotReadMessage( const QByteArray &msg );

signals:
 /**
  * should be connected to the MSNSwitchBoardSocket's sendCommand function
  */
 void sendCommand( const QString &cmd, const QString &args = QString::null,
  bool addId = true, const QByteArray &body = QByteArray() , bool binary=false );

 void fileReceived( KTempFile * , const QString &msnObject );

private:

 enum MessageType { BYE, OK, DECLINE, ERROR, INVITE };

 /**
  * send the MSNSLP command in a msn p2p message
  * dataMessage cen be a QCString in case of text message
  */
 void sendP2PMessage( const QByteArray& dataMessage );
 
 /**
  * make and send a P2P message.
  * @ref sendP2PMessage is used to send the message.
  *
  * @param content is the content of the message. it must be terminated by two \r\n\r\n
  */
 void makeMSNSLPMessage( MessageType type, QString content );


 /**
  * send the ACK
  */
 void sendP2PAck( const char * originalHeader) ;

private slots:
 void slotSendData();
 void slotTransferAccepted(KopeteTransfer*, const QString& );
 void slotFileTransferRefused( const KopeteFileTransferInfo & );
 void slotKopeteTransferDestroyed();

public slots:
 /**
  * Load the dysplayImage.
  */
 void requestDisplayPicture( const QString &myHandle, const QString &msgHandle, QString msnObject);

 /**
  * Abort the current transfer.
  */
 void abortCurrentTransfer();

private:
 //for the display image
 KTempFile *m_file;
 QFile *m_Sfile;
 QFile *m_Rfile;
 QString m_obj;
 
 unsigned long int m_msgIdentifier;
 unsigned long int m_sessionId;
 unsigned long int m_totalDataSize;
 unsigned long int m_offset;
 
 QString m_CallID;
 QString m_branch;


 QString m_myHandle;
 QString m_msgHandle;
 KopeteTransfer *m_kopeteTransfer;

};

#endif

发表于 @ 2005年04月12日 14:08:00 | 评论( loading... ) | 编辑| 举报| 收藏

旧一篇:QQ 2005贺岁版登录口令加密算法及其源代码 (ZT) | 新一篇:MSN P2P 协议实现 msmp2p.cpp

  • 发表评论
  • 评论内容:
  •  
Copyright © fanccYang
Powered by CSDN Blog