Skype4COM: IApplicationStream Interface Reference

Skype4COM

IApplicationStream Interface Reference

ApplicationStream class default interface. More...

import "Skype4COM.idl";

List of all members.

Public Member Functions

HRESULT Read ([out, retval] BSTR *pText)
 This command reads a text string from an application stream.
HRESULT Write ([in] BSTR Text)
 This command writes a text string to an application stream.
HRESULT SendDatagram ([in] BSTR Text)
 This command sends a datagram message. Delivery of the message is not quaranteed.
HRESULT Disconnect ()
 This command disconnects an application stream from an application context.

Properties

BSTR ApplicationName [get]
 This command queries an application name.
BSTR Handle [get]
 This command queries the name of an application stream.
LONG DataLength [get]
 This command queries the data length of an application stream.
BSTR PartnerHandle [get]
 This command queries the Skypename of the sender of an application stream.

Detailed Description

ApplicationStream class default interface.

See also:
IApplication

Member Function Documentation

HRESULT Read ( [out, retval] BSTR *  pText)

This command reads a text string from an application stream.

Parameters:
[out]pTextreceives the text string from the application stream.
HRESULT SendDatagram ( [in] BSTR  Text)

This command sends a datagram message. Delivery of the message is not quaranteed.

Parameters:
[in]Textcontains the message to send.
Note:
To transmit binary data use the base64 encoding to convert your data to strings before passing those strings to IApplication.SendDatagram or IApplicationStream.Write methods.
Example:
 //Declare the variables
 var Skype, App;
 
 //Create the Skype application object.
 Skype = new ActiveXObject("Skype4COM.Skype");
 
 // Connect events:
 WScript.ConnectObject(Skype, "Skype_");
 
 //Create the application object
 var App = Skype.Application("TestBase64DataTransfer");
 
 //Create the application context
 App.Create();
 WScript.Echo ("App created.");
 
 //Connect remote user 
 if (WScript.Arguments.Count() > 0)
 {
   App.Connect(WScript.Arguments.Item(0), true);
   WScript.Echo (WScript.Arguments.Item(0) + " connected.");
 }
 //Byte array 
 var byteArray = new Array(17,34,51,68,85,102,119,136,153,170);
 
 // Send datagram
 if (App.Streams.Count)
 {
   //Encoded byte array
   var encoded = encode64(byteArray);
   
   //Send encoded array to streams
   for (var i=0; i < App.Streams.Count; i++)
   {
     var stm = App.Streams.Item(i+1);
     for (var i=0; i < App.Streams.Count; i++){
       stm.SendDatagram(encoded); 
     }
   }
   WScript.Echo(">Datagram [" + byteArray + "] sent");
 }
 //Sleep 10 minutes
 WScript.Sleep(600000);
 
 //Application datagram events
 function Skype_ApplicationDatagram(aApp, aStream, aText)
 {
   WScript.Echo(">Datagram [" + decode64(aText) + "] received");
 }
 
 //Heres the encode function
 function encode64(inp)
 {
   // Read more about base64 at http://en.wikipedia.org/wiki/Base64
   ... 
 }
 
 //Heres the decode function
 function decode64(inp)
 {
   ...
 }
HRESULT Write ( [in] BSTR  Text)

This command writes a text string to an application stream.

Parameters:
[in]Textcontains the text string to write.

The documentation for this interface was generated from the following file:

Copyright � 2006 Skype Limited. All rights reserved.