summaryrefslogtreecommitdiffabout
path: root/Resolver.cpp
authorMichael Krelin <hacker@klever.net>2012-12-08 21:19:17 (UTC)
committer Michael Krelin <hacker@klever.net>2012-12-11 21:59:29 (UTC)
commit8808689fe340bec6e90ab13dd502292b0579cf1f (patch) (unidiff)
tree45b7c863151341f687b74e40bffcbd7ab5468783 /Resolver.cpp
parent6e7e413ca364d79673e523c09767c18e7cff1bec (diff)
downloadpumpkin-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>
Diffstat (limited to 'Resolver.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--Resolver.cpp71
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
12static char THIS_FILE[] = __FILE__;
13#endif
14
15/////////////////////////////////////////////////////////////////////////////
16// CResolver
17
18CResolver::CResolver()
19{
20 ASSERT(NULL);
21}
22
23CResolver::~CResolver()
24{
25}
26
27
28BEGIN_MESSAGE_MAP(CResolver, CWnd)
29 //{{AFX_MSG_MAP(CResolver)
30 ON_WM_CREATE()
31 ON_MESSAGE(WM_RESOLVED, OnResolved)
32 //}}AFX_MSG_MAP
33END_MESSAGE_MAP()
34
35
36/////////////////////////////////////////////////////////////////////////////
37// CResolver message handlers
38
39CResolver::CResolver(CXferSocket *socket)
40 : socket(socket)
41{
42}
43
44int CResolver::OnCreate(LPCREATESTRUCT lpCreateStruct)
45{
46 if (CWnd::OnCreate(lpCreateStruct) == -1)
47 return -1;
48
49 ASSERT(socket);
50CString hostName = socket->m_HostName;
51int 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
59LRESULT CResolver::OnResolved(WPARAM wP,LPARAM lP)
60{
61 if(WSAGETASYNCERROR(lP))
62 socket->OnFailedToResolve();
63 else
64 socket->OnResolved();
65 return 0;
66}
67
68BOOL CResolver::Resolve()
69{
70 return Create(NULL,"PumpKIN-Resolver",WS_CHILD,CRect(0,0,0,0),socket->m_Daddy,0);
71}