728x90
<
어떻게 하는걸까요 -_-;;;;;;;;;; 너무 어려운데... http://nnoco.tistory.com/26 를 참조하면 쉬울 듯
어떻게 하는걸까요 -_-;;;;;;;;;; 너무 어려운데... http://nnoco.tistory.com/26 를 참조하면 쉬울 듯
int _tmain(int argc, char* argv[])
{
try
{
// io_service를 하나 생성한다.
boost::asio::io_service io_service;
// 접속 시도
CProtocol Ptc(io_service);
boost::thread t(boost::bind(&boost::asio::io_service::run, &io_service));
Ptc.Connect();
boost::thread Recv(boost::bind(&CProtocol::handle_Recive, &Ptc));
boost::thread Send(boost::bind(&CProtocol::handle_Send, &Ptc));
io_service.run();
while(Ptc.IsRun())
{
}
Recv.join();
Send.join();
t.join(); // 쓰레드가 종료될 때까지 메인 함수의 종료를 막는다
}
catch (std::exception& e)
{
std::cerr << e.what() << std::endl;
}
int in;
std::cout << "END";
std::cin >> in ;
return 0;
}
이러면 되는걸까요? 728x90
'프로그래밍 > C++ / API' 카테고리의 다른 글
| 미리 컴파일된 헤더의 가상 메모리 범위 초과 (0) | 2012.11.23 |
|---|---|
| 오버라이드(Override)와 가상함수(Virtual Function) (0) | 2012.09.06 |
| 디아블로3 채팅 아이템 정보 넘기기 (0) | 2012.05.21 |
| 환경 변수 설정 (0) | 2012.03.02 |
| char* / char[] 공백문자 제거 (0) | 2011.11.02 |
댓글