You Are Here:

Community: Developer Discussion Boards

#1 Old Which port number to use when connecting to remote device? - 2003-11-13, 16:45

Join Date: Jun 2003
Posts: 318
advocatee
Offline
Regular Contributor
Hi,

I think i'll be using something like this on my client (using RHostResolver and TNameEntry):

//got this from one of the threads
TBTSockAddr iBTSockAddr( iNameEntry().iAddr);
iBTSockAddr.SetBTAddr(iBTSockAddr.BTAddr());
iBTSockAddr.SetPort(KRfcommChannel);
iSendingSocket.Connect(iBTSockAddr,iStatus);

My questions are:

1) I'm not sure about the KRfcommChannel though. I'm using L2CAP and RFCOMM. What is the difference if i use

iBTSockAddr.SetPort(iBTSockAddr.Port());

?


.......


2) I'm assuming that this port corresponds to the servers port.. Am i right?

//Server code:
User::LeaveIfError(
iListeningSocket.GetOpt(KRFCOMMGetAvailableServerChannel, KSolBtRFCOMM, channel)
);
TBTSockAddr listeningAddress;
listeningAddress.SetPort(channel); //the port the client connects to corresponds to 'channel'?
iListeningSocket.Accept(iAcceptedSocket, iStatus);
SetActive();


Please advise... thanks

- aDvo -
Reply With Quote

#2 Old 2003-11-14, 11:54

Join Date: Mar 2003
Posts: 27
stevecotton
Offline
Registered User
RFComm channels are generally dynamically assigned, as done by GetOpt().

The server needs to advertise itself in the SDP database, and the client needs to parse the appropriate record for information about how to connect.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia