03.01.2013 Views

Chapter 1

Chapter 1

Chapter 1

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

inline RGsdpSession() : iHandler(0) { };<br />

// open/close<br />

IMPORT_C void ConnectL(MGsdpPacketHandler& aHandler);<br />

IMPORT_C void Close();<br />

// Query supported protocols<br />

IMPORT_C TInt CountGdpProtocols() const;<br />

IMPORT_C TInt GetGdpProtocolInfo(TInt aProto,TGdpProtocolInfo&<br />

aInfo) const;<br />

// load and get GDP protocol<br />

IMPORT_C TInt SetGdpProtocol(TUid aProtocol);<br />

IMPORT_C TUid GetGdpProtocol() const;<br />

IMPORT_C TBool GdpIsNetworked() const;<br />

// game protocol<br />

IMPORT_C void SetGameProtocol(TUint32 aProtocol);<br />

IMPORT_C TUint32 GetGameProtocol() const;<br />

// set and get my address and port<br />

IMPORT_C void SetMyPort(TUint32 aPort);<br />

IMPORT_C TUint32 GetMyPort() const;<br />

IMPORT_C TUint32 AllocMyNextPort();<br />

// set and get other address and port<br />

IMPORT_C void SetOtherAddress(const TDesC& aAddress);<br />

IMPORT_C void GetOtherAddress(TDes& aAddress) const;<br />

IMPORT_C void SetOtherPort(TUint32 aPort);<br />

IMPORT_C TUint32 GetOtherPort() const;<br />

// main protocol functions<br />

IMPORT_C void Listen();<br />

IMPORT_C void StopListening();<br />

IMPORT_C void Send(const TDesC8& aData);<br />

// initiate receive-all for "pull" protocols<br />

IMPORT_C void ReceiveAll() const;<br />

private:<br />

friend class CGsdpReceiveHandler;<br />

void Receive(TDes8& aBuffer, TRequestStatus& aStatus);<br />

void CancelReceive();<br />

CGsdpReceiveHandler* iHandler;<br />

};<br />

The functions of RGsdpSession include the following:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!