다른 Open Source등에서 OpenSSL을 사용하는 경우가 많습니다.
그래서, OpenSSL의 빌드가 필요한 경우가 많은데, VC9.0에서 빌드하는 방법을 알려드립니다.
VC9.0 재배포팩이 필요한 dll 버전과 재배포팩과 다른 의존성 없이 독단적으로 빌드 가능한 버전 2개를 공유합니다.
1) OpenSSL Source 다운로드
http://www.openssl.org/source/
(1.0.0d 버전을 기준으로 작성되었습니다.)
2) 빌드 머신에 Active Perl 설치
http://www.activestate.com/activeperl/downloads
3) 임의의 경로에 openssl 압축 해제
예) D:\Src\openssl-1.0.0d
4) 몇몇 파일을 unicode로 수정하여 저장
openssl-1.0.0d/crypto/x509v3/v3_pci.c
openssl-1.0.0d/crypto/x509v3/v3_pcia.c
5) openssl-1.0.d 경로에 첨부된 두 파일을 복사
openssl-1.0.0d/_build.bat
openssl-1.0.0d/_build.static.bat
6) _build.bat / _build.static.bat 실행
7) openssl-1.0.0d/build 와 openssl-1.0.0d/build.static에 빌드본 완료
8) openssl-1.0.0d/build/bin/openssl.exe는
와 같기 때문에 VC9.0 재배포팩과 같은 경로의 SSLEAY32.DLL와 LIBEAY32.DLL가 필수
9) openssl-1.0.0d/build.static/bin/openssl.exe는
와 같기 때문에, openssl.exe 단독으로 배포 가능함
10) openssl-1.0.0d/build.static/lib에는 다른 프로젝트에서 끌어다 쓸 수 있는 lib가 들어감
출처 : http://msdn.microsoft.com/ko-kr/library/cc438567(v=vs.71).aspx
Native C++ 이벤트 처리에서 event_source 및 event_receiver 특성을 사용하고 각각 type=native를 지정하여 이벤트 소스 및 이벤트 수신기를 설정합니다. 이들 특성을 사용하면 해당 특성이 적용되는 클래스에서 이벤트를 발생시킬 수 있으며 COM이 아닌 기본 컨텍스트의 이벤트를 처리할 수 있습니다.
이벤트 선언
이벤트 소스 클래스의 메서드 선언에서 __event 키워드를 사용하여 메서드를 이벤트로 선언합니다. 메서드를 선언하되 정의하지는 마십시오. 컴파일러가 메서드를 이벤트로 만들 때 암시적으로 메서드를 정의하기 때문에 메서드를 정의하면 컴파일러 오류가 발생합니다. 기본 이벤트는 0개 이상의 매개 변수를 가질 수 있는데 메서드일 수 있습니다. 반환 형식은 void 또는 모든 정수 계열 형식이 될 수 있습니다.
이벤트 처리기 정의
이벤트 수신기 클래스에서 처리하려는 이벤트와 시그니처(반환 형식, 호출 규칙 및 인수)가 일치하는 메서드인 이벤트 처리기를 정의합니다.
이벤트에 이벤트 처리기 후크
또한 이벤트 수신기 클래스에서 내장 함수 __hook를 사용하여 이벤트를 이벤트 처리기와 연결하고 __unhook를 사용하여 이벤트와 이벤트 처리기 연결을 끊습니다. 몇 개의 이벤트를 하나의 이벤트 처리기에 후크하거나 몇 개의 이벤트 처리기를 하나의 이벤트에 후크할 수 있습니다.
이벤트 발생
이벤트를 발생시키려면 이벤트 소스 클래스에서 이벤트로 선언된 메서드를 호출합니다. 처리기가 이벤트에 후크된 경우 처리기가 호출됩니다.
Native C++ 이벤트 코드
다음 예제는 Native C++에서 이벤트를 발생시키는 방법을 보여 줍니다. 코드의 주석을 참조하여 예제를 컴파일하고 실행합니다.
// evh_native.cpp
#include <stdio.h>
[event_source(native)]
class CSource {
public:
__event void MyEvent(int nValue);
};
[event_receiver(native)]
class CReceiver {
public:
void MyHandler1(int nValue) {
printf("MyHandler1 was called with value %d.\n", nValue);
}
void MyHandler2(int nValue) {
printf("MyHandler2 was called with value %d.\n", nValue);
}
void hookEvent(CSource* pSource) {
__hook(&CSource::MyEvent, pSource, &CReceiver::MyHandler1);
__hook(&CSource::MyEvent, pSource, &CReceiver::MyHandler2);
}
void unhookEvent(CSource* pSource) {
__unhook(&CSource::MyEvent, pSource, &CReceiver::MyHandler1);
__unhook(&CSource::MyEvent, pSource, &CReceiver::MyHandler2);
}
};
int main() {
CSource source;
CReceiver receiver;
receiver.hookEvent(&source);
__raise source.MyEvent(123);
receiver.unhookEvent(&source);
}
출력
MyHandler2 was called with value 123. MyHandler1 was called with value 123.
인터넷 TCP/IP소켓 (Internet TCP/IP Socket)을 5000개 이상 다수 오픈 방법

http://support.microsoft.com/default.aspx?scid=kb;en-us;196271
When you try to connect from TCP ports greater than 5000 you receive the error 'WSAENOBUFS (10055)'
| System TipThis article applies to a different version of Windows than the one you are using. Content in this article may not be relevant to you. Visit the Windows 7 Solution Center | ![]() |
On This Page
SYMPTOMS
RESOLUTION
The default maximum number of ephemeral TCP ports is 5000 in the products that are included in the "Applies to" section. A new parameter has been added in these products. To increase the maximum number of ephemeral ports, follow these steps:
- Start Registry Editor.
- Locate the following subkey in the registry, and then click Parameters:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
- On the Edit menu, click New, and then add the following registry entry:Value Name: MaxUserPort
Value Type: DWORD
Value data: 65534
Valid Range: 5000-65534 (decimal)
Default: 0x1388 (5000 decimal)
Description: This parameter controls the maximum port number that is used when a program requests any available user port from the system. Typically, ephemeral (short-lived) ports are allocated between the values of 1024 and 5000 inclusive. After the release of security bulletin MS08-037, the behavior of Windows Server 2003 was changed to more closely match that of Windows Server 2008 and Windows Vista. For more information about Microsoft security bulletin MS08-037, click the following article numbers to view the articles in the Microsoft Knowledge Base:951746 MS08-037: Description of the security update for DNS in Windows Server 2008, in Windows Server 2003, and in Windows 2000 Server (DNS server-side): July 8, 2008951748 MS08-037: Description of the security update for DNS in Windows Server 2003, in Windows XP, and in Windows 2000 Server (client side): July 8, 2008953230 MS08-037: Vulnerabilities in DNS could allow spoofing - Exit Registry Editor, and then restart the computer.
_build.static.bat

Back to the top
Prev
Rss Feed