|
1 |
|
2 /***********************************************************************************************************************/ |
|
3 |
|
4 WEEK 8 code drop |
|
5 |
|
6 /***********************************************************************************************************************/ |
|
7 |
|
8 Steps to load protocol. |
|
9 |
|
10 1. build napt |
|
11 |
|
12 2. on any application do |
|
13 |
|
14 RSocketServer sock_server; |
|
15 |
|
16 RSOcket socket; |
|
17 socket.Open(sock_server ,_L("napt")); |
|
18 |
|
19 |
|
20 /************************************************************************************************************* |
|
21 |
|
22 This drop supports specified downlink. You need to send Interface Index information for both private and global Interace. |
|
23 **************************************************************************************************************/ |
|
24 |
|
25 |
|
26 //////Steps to do it with Example. |
|
27 |
|
28 /////Open socket on that connection.i.e |
|
29 |
|
30 RConnection con; //global |
|
31 con.Start(sock_server); //If not started. If started attach it to existing connection |
|
32 |
|
33 RSocket sock; |
|
34 sock.Open( on conn); // Open(sock_Server, KAfInet, KSockDatagram, KProtocolInetUdp, con); |
|
35 |
|
36 Sock.Send() //send some dummy data through this interface; |
|
37 |
|
38 TPckg<TInt> indexBuf(index); |
|
39 sock.GetOpt(KSoInterfaceIndex, KSolInetIp , index);//KSolInetIp |
|
40 |
|
41 |
|
42 |
|
43 //////////Similarly you can take interafce index of private interface. |
|
44 |
|
45 |
|
46 1. Open Connection on that interface. |
|
47 |
|
48 2. Open connection bound socket. |
|
49 |
|
50 3. Send dummy information. |
|
51 |
|
52 4. GetOpt and take interface Index. |
|
53 |
|
54 |
|
55 /************************************************************************************************************** |
|
56 Now how to set these options to napt..... |
|
57 |
|
58 ***************************************************************************************************************/ |
|
59 |
|
60 |
|
61 socket.setopt (Downlink , private , NULL ); |
|
62 |
|
63 ////////////// socket is the socket instance that is opened on napt. |
|
64 |
|
65 //////////// downlink is the interface index of downlink interface , private one is for private Interface. |
|
66 |
|
67 |
|
68 |
|
69 |
|
70 /************************************************END***********************************************************/ |