author | Michael Krelin <hacker@klever.net> | 2012-12-08 21:19:17 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2012-12-11 21:59:29 (UTC) |
commit | 8808689fe340bec6e90ab13dd502292b0579cf1f (patch) (unidiff) | |
tree | 45b7c863151341f687b74e40bffcbd7ab5468783 /Resolver.cpp | |
parent | 6e7e413ca364d79673e523c09767c18e7cff1bec (diff) | |
download | pumpkin-osx/0.0.zip pumpkin-osx/0.0.tar.gz pumpkin-osx/0.0.tar.bz2 |
initial osx portosx/0.0
Signed-off-by: Michael Krelin <hacker@klever.net>
-rw-r--r-- | Resolver.cpp | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/Resolver.cpp b/Resolver.cpp deleted file mode 100644 index 0ec66d3..0000000 --- a/Resolver.cpp +++ b/dev/null | |||
@@ -1,71 +0,0 @@ | |||
1 | // Resolver.cpp : implementation file | ||
2 | // | ||
3 | |||
4 | #include "stdafx.h" | ||
5 | #include "PumpKIN.h" | ||
6 | #include "Resolver.h" | ||
7 | #include "PumpKINDlg.h" | ||
8 | |||
9 | #ifdef _DEBUG | ||
10 | #define new DEBUG_NEW | ||
11 | #undef THIS_FILE | ||
12 | static char THIS_FILE[] = __FILE__; | ||
13 | #endif | ||
14 | |||
15 | ///////////////////////////////////////////////////////////////////////////// | ||
16 | // CResolver | ||
17 | |||
18 | CResolver::CResolver() | ||
19 | { | ||
20 | ASSERT(NULL); | ||
21 | } | ||
22 | |||
23 | CResolver::~CResolver() | ||
24 | { | ||
25 | } | ||
26 | |||
27 | |||
28 | BEGIN_MESSAGE_MAP(CResolver, CWnd) | ||
29 | //{{AFX_MSG_MAP(CResolver) | ||
30 | ON_WM_CREATE() | ||
31 | ON_MESSAGE(WM_RESOLVED, OnResolved) | ||
32 | //}}AFX_MSG_MAP | ||
33 | END_MESSAGE_MAP() | ||
34 | |||
35 | |||
36 | ///////////////////////////////////////////////////////////////////////////// | ||
37 | // CResolver message handlers | ||
38 | |||
39 | CResolver::CResolver(CXferSocket *socket) | ||
40 | : socket(socket) | ||
41 | { | ||
42 | } | ||
43 | |||
44 | int CResolver::OnCreate(LPCREATESTRUCT lpCreateStruct) | ||
45 | { | ||
46 | if (CWnd::OnCreate(lpCreateStruct) == -1) | ||
47 | return -1; | ||
48 | |||
49 | ASSERT(socket); | ||
50 | CString hostName = socket->m_HostName; | ||
51 | int at = hostName.Find('@'); | ||
52 | if(at>=0) | ||
53 | hostName=hostName.Mid(at+1); | ||
54 | m_hAsync=WSAAsyncGetHostByName(m_hWnd,WM_RESOLVED,(LPCTSTR)hostName,(char*)socket->m_ResolveBuff,sizeof(socket->m_ResolveBuff)); | ||
55 | ASSERT(m_hAsync); | ||
56 | return 0; | ||
57 | } | ||
58 | |||
59 | LRESULT CResolver::OnResolved(WPARAM wP,LPARAM lP) | ||
60 | { | ||
61 | if(WSAGETASYNCERROR(lP)) | ||
62 | socket->OnFailedToResolve(); | ||
63 | else | ||
64 | socket->OnResolved(); | ||
65 | return 0; | ||
66 | } | ||
67 | |||
68 | BOOL CResolver::Resolve() | ||
69 | { | ||
70 | return Create(NULL,"PumpKIN-Resolver",WS_CHILD,CRect(0,0,0,0),socket->m_Daddy,0); | ||
71 | } | ||