equal
deleted
inserted
replaced
|
1 /* |
|
2 * Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 #include <in_sock.h> |
|
19 |
|
20 #include "CTcTcpConnection.h" |
|
21 |
|
22 CTcTcpConnection::CTcTcpConnection( TInt aPort ) |
|
23 { |
|
24 iLocalPort = aPort; |
|
25 } |
|
26 |
|
27 CTcTcpConnection::~CTcTcpConnection() |
|
28 { |
|
29 } |
|
30 |
|
31 void CTcTcpConnection::SetupPortL() |
|
32 { |
|
33 // Open listening TCP socket |
|
34 User::LeaveIfError( iListeningSocket.Open( *iSocketServ, |
|
35 KAfInet, // KAfInet6 |
|
36 KSockStream, |
|
37 KProtocolInetTcp ) ); |
|
38 } |
|
39 |
|
40 void CTcTcpConnection::SetupPort2L() |
|
41 { |
|
42 if ( iConnection ) |
|
43 { |
|
44 User::LeaveIfError( iSocket.Open( *iSocketServ, |
|
45 KAfInet, // KAfInet6 |
|
46 KSockStream, |
|
47 KProtocolInetTcp, |
|
48 *iConnection ) ); |
|
49 } |
|
50 else |
|
51 { |
|
52 User::LeaveIfError( iSocket.Open( *iSocketServ, |
|
53 KAfInet, // KAfInet6 |
|
54 KSockStream, |
|
55 KProtocolInetTcp ) ); |
|
56 } |
|
57 } |