equal
deleted
inserted
replaced
|
1 // ServerSocket.h |
|
2 // |
|
3 // Copyright (c) 2010 Accenture. All rights reserved. |
|
4 // This component and the accompanying materials are made available |
|
5 // under the terms of the "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 // Accenture - Initial contribution |
|
11 // |
|
12 |
|
13 #if !defined(AFX_SERVERSOCKET_H__1B6002D0_3BFE_4640_A9E6_566461E06718__INCLUDED_) |
|
14 #define AFX_SERVERSOCKET_H__1B6002D0_3BFE_4640_A9E6_566461E06718__INCLUDED_ |
|
15 |
|
16 #if _MSC_VER > 1000 |
|
17 #pragma once |
|
18 #endif // _MSC_VER > 1000 |
|
19 |
|
20 #include "Socket.h" |
|
21 |
|
22 |
|
23 class CClientSocket; |
|
24 |
|
25 |
|
26 class MSocketClientAcceptor |
|
27 { |
|
28 public: |
|
29 virtual void HandleNewClient(CClientSocket& aClientSocket) = 0; |
|
30 }; |
|
31 |
|
32 |
|
33 class CServerSocket : public CSocket |
|
34 { |
|
35 public: |
|
36 static CServerSocket* New(CWindow& aWindow); |
|
37 virtual ~CServerSocket(); |
|
38 void Listen(unsigned short aPort, unsigned int aBacklogSize, MSocketClientAcceptor& aClientAcceptor); |
|
39 private: |
|
40 CServerSocket(CWindow& aWindow); |
|
41 void Construct(); |
|
42 void HandleAccept(); |
|
43 private: // From CSocket. |
|
44 virtual LRESULT HandleSocketMessage(LPARAM aLParam); |
|
45 private: |
|
46 MSocketClientAcceptor* iClientAcceptor; |
|
47 }; |
|
48 |
|
49 #endif // !defined(AFX_SERVERSOCKET_H__1B6002D0_3BFE_4640_A9E6_566461E06718__INCLUDED_) |