I want to connect to Irda server application running on windows 2000.I have written following code for client but not able to get what port number to specify while connecting to server(value of KBeamPortNumber in following code). Because at server end i had not given any port number to connect I had just specified service name "MyServer".
Secondly is there is any way to test this client application from emulator.

RSocketServ SocServer;
TProtocolDesc pInfo;
TInt ret;

SocServer.Connect();
TProtocolName KTinyTP = _L("IrTinyTP"
ret = SocServer.FindProtocol(KTinyTP,pInfo);
if(ret!=KErrNone)
{
return false;
}

RHostResolver hr1;
ret = hr1.Open(SocServer,pInfo.iAddrFamily,pInfo.iSockType);
if(ret!=KErrNone)
{
return false;
}

TNameEntry log;
THostName name = _L("MyServer"
ret = hr1.GetByName(name,log);
if(ret!=KErrNone)
{
return false;
}
hr1.Close();

RSocket client;
client.Open(SocServer,pInfo.iAddrFamily,pInfo.iSockType,pInfo.iProtocol);
log().iAddr.SetPort(KBeamPortNumber);
TRequestStatus stat;

client.Connect(log().iAddr,stat);
TBuf8<100> buf;
buf.FillZ();
client.Write(buf,stat);
return true;
client.Close();
SocServer.Close();