Microsoft MVP성태의 닷넷 이야기
VC++: 124. libuv 모듈 살펴 보기 [링크 복사], [링크+제목 복사]
조회: 3896
글쓴 사람
홈페이지
첨부 파일
 

libuv 모듈 살펴 보기

ASP.NET Core 프로젝트는 기반 프레임워크에 따라 2가지로 나뉩니다.

"ASP.NET Core Web Application (.NET Core)"와 "ASP.NET Core Web Application (.NET Framework)" 차이점
; https://www.sysnet.pe.kr/2/0/11121

재미있는 것은, .NET Framework을 기반으로 한 ASP.NET Core 프로젝트의 경우 반드시 Platform 설정을 x86 또는 x64로 명시해야 한다는 점입니다. 그 이유는 배포(또는 빌드) 디렉터리를 보면 알 수 있는데요. ".NET Core"용 ASP.NET Core 프로젝트의 경우 다음과 같은 정도의 파일만 있는 반면,

appsettings.Development.json
appsettings.json
web.config
WebApplication1.deps.json
WebApplication1.dll
WebApplication1.pdb
WebApplication1.PrecompiledViews.dll
WebApplication1.PrecompiledViews.pdb
WebApplication1.runtimeconfig.json

".NET Framework"용 ASP.NET Core 프로젝트를 배포(또는 빌드)하면 곧바로 실행 가능한 유형의 EXE로 구성되기 때문에 모든 의존성 있는 모듈을 포함하게 됩니다.

appsettings.Development.json
appsettings.json
libuv.dll
Microsoft.AspNetCore.Antiforgery.dll
Microsoft.AspNetCore.Authentication.Abstractions.dll
Microsoft.AspNetCore.Authentication.Core.dll
Microsoft.AspNetCore.Authorization.dll
Microsoft.AspNetCore.Authorization.Policy.dll
Microsoft.AspNetCore.Cors.dll
Microsoft.AspNetCore.Cryptography.Internal.dll
Microsoft.AspNetCore.DataProtection.Abstractions.dll
Microsoft.AspNetCore.DataProtection.dll
Microsoft.AspNetCore.Diagnostics.Abstractions.dll
Microsoft.AspNetCore.Diagnostics.dll
Microsoft.AspNetCore.dll
Microsoft.AspNetCore.Hosting.Abstractions.dll
Microsoft.AspNetCore.Hosting.dll
Microsoft.AspNetCore.Hosting.Server.Abstractions.dll
Microsoft.AspNetCore.Html.Abstractions.dll
Microsoft.AspNetCore.Http.Abstractions.dll
Microsoft.AspNetCore.Http.dll
Microsoft.AspNetCore.Http.Extensions.dll
Microsoft.AspNetCore.Http.Features.dll
Microsoft.AspNetCore.HttpOverrides.dll
Microsoft.AspNetCore.JsonPatch.dll
Microsoft.AspNetCore.Localization.dll
Microsoft.AspNetCore.Mvc.Abstractions.dll
Microsoft.AspNetCore.Mvc.ApiExplorer.dll
Microsoft.AspNetCore.Mvc.Core.dll
Microsoft.AspNetCore.Mvc.Cors.dll
Microsoft.AspNetCore.Mvc.DataAnnotations.dll
Microsoft.AspNetCore.Mvc.dll
Microsoft.AspNetCore.Mvc.Formatters.Json.dll
Microsoft.AspNetCore.Mvc.Localization.dll
Microsoft.AspNetCore.Mvc.Razor.dll
Microsoft.AspNetCore.Mvc.Razor.Extensions.dll
Microsoft.AspNetCore.Mvc.RazorPages.dll
Microsoft.AspNetCore.Mvc.TagHelpers.dll
Microsoft.AspNetCore.Mvc.ViewFeatures.dll
Microsoft.AspNetCore.Razor.dll
Microsoft.AspNetCore.Razor.Language.dll
Microsoft.AspNetCore.Razor.Runtime.dll
Microsoft.AspNetCore.ResponseCaching.Abstractions.dll
Microsoft.AspNetCore.Routing.Abstractions.dll
Microsoft.AspNetCore.Routing.dll
Microsoft.AspNetCore.Server.IISIntegration.dll
Microsoft.AspNetCore.Server.Kestrel.Core.dll
Microsoft.AspNetCore.Server.Kestrel.dll
Microsoft.AspNetCore.Server.Kestrel.Https.dll
Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions.dll
Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.dll
Microsoft.AspNetCore.WebUtilities.dll
Microsoft.CodeAnalysis.CSharp.dll
Microsoft.CodeAnalysis.dll
Microsoft.CodeAnalysis.Razor.dll
Microsoft.DotNet.PlatformAbstractions.dll
Microsoft.Extensions.Caching.Abstractions.dll
Microsoft.Extensions.Caching.Memory.dll
Microsoft.Extensions.Configuration.Abstractions.dll
Microsoft.Extensions.Configuration.Binder.dll
Microsoft.Extensions.Configuration.CommandLine.dll
Microsoft.Extensions.Configuration.dll
Microsoft.Extensions.Configuration.EnvironmentVariables.dll
Microsoft.Extensions.Configuration.FileExtensions.dll
Microsoft.Extensions.Configuration.Json.dll
Microsoft.Extensions.Configuration.UserSecrets.dll
Microsoft.Extensions.DependencyInjection.Abstractions.dll
Microsoft.Extensions.DependencyInjection.dll
Microsoft.Extensions.DependencyModel.dll
Microsoft.Extensions.FileProviders.Abstractions.dll
Microsoft.Extensions.FileProviders.Composite.dll
Microsoft.Extensions.FileProviders.Physical.dll
Microsoft.Extensions.FileSystemGlobbing.dll
Microsoft.Extensions.Hosting.Abstractions.dll
Microsoft.Extensions.Localization.Abstractions.dll
Microsoft.Extensions.Localization.dll
Microsoft.Extensions.Logging.Abstractions.dll
Microsoft.Extensions.Logging.Configuration.dll
Microsoft.Extensions.Logging.Console.dll
Microsoft.Extensions.Logging.Debug.dll
Microsoft.Extensions.Logging.dll
Microsoft.Extensions.ObjectPool.dll
Microsoft.Extensions.Options.ConfigurationExtensions.dll
Microsoft.Extensions.Options.dll
Microsoft.Extensions.Primitives.dll
Microsoft.Extensions.WebEncoders.dll
Microsoft.Net.Http.Headers.dll
Microsoft.Win32.Primitives.dll
Microsoft.Win32.Registry.dll
netstandard.dll
Newtonsoft.Json.Bson.dll
Newtonsoft.Json.dll
[refs]
System.AppContext.dll
System.Buffers.dll
System.Collections.Concurrent.dll
System.Collections.dll
System.Collections.Immutable.dll
System.Collections.NonGeneric.dll
System.Collections.Specialized.dll
System.ComponentModel.Annotations.dll
System.ComponentModel.dll
System.ComponentModel.EventBasedAsync.dll
System.ComponentModel.Primitives.dll
System.ComponentModel.TypeConverter.dll
System.Console.dll
System.Data.Common.dll
System.Diagnostics.Contracts.dll
System.Diagnostics.Debug.dll
System.Diagnostics.DiagnosticSource.dll
System.Diagnostics.FileVersionInfo.dll
System.Diagnostics.Process.dll
System.Diagnostics.StackTrace.dll
System.Diagnostics.TextWriterTraceListener.dll
System.Diagnostics.Tools.dll
System.Diagnostics.TraceSource.dll
System.Diagnostics.Tracing.dll
System.Drawing.Primitives.dll
System.Dynamic.Runtime.dll
System.Globalization.Calendars.dll
System.Globalization.dll
System.Globalization.Extensions.dll
System.IO.Compression.dll
System.IO.Compression.ZipFile.dll
System.IO.dll
System.IO.FileSystem.dll
System.IO.FileSystem.DriveInfo.dll
System.IO.FileSystem.Primitives.dll
System.IO.FileSystem.Watcher.dll
System.IO.IsolatedStorage.dll
System.IO.MemoryMappedFiles.dll
System.IO.Pipes.dll
System.IO.UnmanagedMemoryStream.dll
System.Linq.dll
System.Linq.Expressions.dll
System.Linq.Parallel.dll
System.Linq.Queryable.dll
System.Net.Http.dll
System.Net.NameResolution.dll
System.Net.NetworkInformation.dll
System.Net.Ping.dll
System.Net.Primitives.dll
System.Net.Requests.dll
System.Net.Security.dll
System.Net.Sockets.dll
System.Net.WebHeaderCollection.dll
System.Net.WebSockets.Client.dll
System.Net.WebSockets.dll
System.Numerics.Vectors.dll
System.ObjectModel.dll
System.Reflection.dll
System.Reflection.Extensions.dll
System.Reflection.Metadata.dll
System.Reflection.Primitives.dll
System.Resources.Reader.dll
System.Resources.ResourceManager.dll
System.Resources.Writer.dll
System.Runtime.CompilerServices.Unsafe.dll
System.Runtime.CompilerServices.VisualC.dll
System.Runtime.dll
System.Runtime.Extensions.dll
System.Runtime.Handles.dll
System.Runtime.InteropServices.dll
System.Runtime.InteropServices.RuntimeInformation.dll
System.Runtime.Numerics.dll
System.Runtime.Serialization.Formatters.dll
System.Runtime.Serialization.Json.dll
System.Runtime.Serialization.Primitives.dll
System.Runtime.Serialization.Xml.dll
System.Security.AccessControl.dll
System.Security.Claims.dll
System.Security.Cryptography.Algorithms.dll
System.Security.Cryptography.Csp.dll
System.Security.Cryptography.Encoding.dll
System.Security.Cryptography.Primitives.dll
System.Security.Cryptography.X509Certificates.dll
System.Security.Cryptography.Xml.dll
System.Security.Principal.dll
System.Security.Principal.Windows.dll
System.Security.SecureString.dll
System.Text.Encoding.CodePages.dll
System.Text.Encoding.dll
System.Text.Encoding.Extensions.dll
System.Text.Encodings.Web.dll
System.Text.RegularExpressions.dll
System.Threading.dll
System.Threading.Overlapped.dll
System.Threading.Tasks.dll
System.Threading.Tasks.Extensions.dll
System.Threading.Tasks.Parallel.dll
System.Threading.Thread.dll
System.Threading.ThreadPool.dll
System.Threading.Timer.dll
System.ValueTuple.dll
System.Xml.ReaderWriter.dll
System.Xml.XDocument.dll
System.Xml.XmlDocument.dll
System.Xml.XmlSerializer.dll
System.Xml.XPath.dll
System.Xml.XPath.XDocument.dll
web.config
WebApplication2.deps.json
WebApplication2.exe
WebApplication2.exe.config
WebApplication2.pdb

이 중에서 문제가 되는 것은 네이티브 모듈인 libuv.dll입니다. 이에 대해서는 전에도 한번 언급했습니다.

.NET Core 오류 - 0x80131620 Unable to load DLL 'libuv'
; https://www.sysnet.pe.kr/2/0/11389

libuv 모듈은 꽤나 유명한 비동기 I/O 라이브러리인데, node.js에서도 사용하기 때문에 낯익은 분도 있을 것입니다. Visual C++과 vcpkg를 이용하면 직접 빌드해 보는 것도 가능한데요.

오픈 소스 라이브러리를 쉽게 빌드해 주는 "C++ Package Manager for Windows: vcpkg"
; https://www.sysnet.pe.kr/2/0/11409

이렇게 쉽습니다. ^^

E:\git_clone\vcpkg> vcpkg install libuv:x64-windows
The following packages will be built and installed:
    libuv[core]:x64-windows
Starting package 1/1: libuv:x64-windows
Building package libuv:x64-windows...
-- CURRENT_INSTALLED_DIR=E:/git_clone/vcpkg/installed/x64-windows
-- DOWNLOADS=E:/git_clone/vcpkg/downloads
-- CURRENT_PACKAGES_DIR=E:/git_clone/vcpkg/packages/libuv_x64-windows
-- CURRENT_BUILDTREES_DIR=E:/git_clone/vcpkg/buildtrees/libuv
-- CURRENT_PORT_DIR=E:/git_clone/vcpkg/ports/libuv/.
-- Downloading https://github.com/libuv/libuv/archive/v1.18.0.tar.gz...
-- Downloading https://github.com/libuv/libuv/archive/v1.18.0.tar.gz... OK
-- Testing integrity of downloaded file...
-- Testing integrity of downloaded file... OK
-- Extracting source E:/git_clone/vcpkg/downloads/libuv-libuv-v1.18.0.tar.gz
-- Extracting done
-- Configuring x64-windows-rel
-- Configuring x64-windows-rel done
-- Configuring x64-windows-dbg
-- Configuring x64-windows-dbg done
-- Build x64-windows-rel
-- Build x64-windows-rel done
-- Build x64-windows-dbg
-- Build x64-windows-dbg done
-- Performing post-build validation
-- Performing post-build validation done
Building package libuv:x64-windows... done
Installing package libuv:x64-windows...
Installing package libuv:x64-windows... done
Elapsed time for package libuv:x64-windows: 18.16 s

Total elapsed time: 18.16 s

실제로 이렇게 빌드한 것을 ASP.NET Core 프로젝트가 배포된 폴더의 libuv.dll을 덮어쓰면 pdb 파일과 소스 코드 파일이 연동되기 때문에 mixed mode 디버깅 환경으로 설정하면,

ASP.NET Core 프로젝트의 "Enable unmanaged code debugging" 옵션 켜는 방법
; https://www.sysnet.pe.kr/2/0/11442

이런 식의 디버깅도 가능합니다.

libuv_core_1.png




원한다면, vcpkg로 빌드된 libuv.dll을 이용해 C++ 환경에서 async I/O 서버를 만들 수도 있습니다.

An Introduction to libuv Programing/Node.js 2014.04.01 14:09 
; http://namocom.tistory.com/319?category=439241

An Introduction to libuv
; http://nikhilm.github.io/uvbook/

// ConsoleApplication1.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <uv.h>

int main()
{
    uv_loop_t loop;
    
    uv_loop_init(&loop);

    printf("...");
    uv_run(&loop, UV_RUN_DEFAULT);

    uv_loop_close(&loop);

    return 0;
}

하지만 저도 이번엔 여기까지만! ^^ (물론 찾아보면 C# 래퍼도 있습니다.)

참고로, depends.exe로 살펴보면 다음과 같은 API들이 있는 걸 확인할 수 있습니다.

uv_accept
uv_async_init
uv_async_send
uv_backend_fd
uv_backend_timeout
uv_barrier_destroy
uv_barrier_init
uv_barrier_wait
uv_buf_init
uv_cancel
uv_chdir
uv_check_init
uv_check_start
uv_check_stop
uv_close
uv_cond_broadcast
uv_cond_destroy
uv_cond_init
uv_cond_signal
uv_cond_timedwait
uv_cond_wait
uv_cpu_info
uv_cwd
uv_default_loop
uv_disable_stdio_inheritance
uv_dlclose
uv_dlerror
uv_dlopen
uv_dlsym
uv_err_name
uv_exepath
uv_fileno
uv_free_cpu_info
uv_free_interface_addresses
uv_freeaddrinfo
uv_fs_access
uv_fs_chmod
uv_fs_chown
uv_fs_close
uv_fs_event_getpath
uv_fs_event_init
uv_fs_event_start
uv_fs_event_stop
uv_fs_fchmod
uv_fs_fchown
uv_fs_fdatasync
uv_fs_fstat
uv_fs_fsync
uv_fs_ftruncate
uv_fs_futime
uv_fs_link
uv_fs_lstat
uv_fs_mkdir
uv_fs_mkdtemp
uv_fs_open
uv_fs_poll_getpath
uv_fs_poll_init
uv_fs_poll_start
uv_fs_poll_stop
uv_fs_read
uv_fs_readlink
uv_fs_realpath
uv_fs_rename
uv_fs_req_cleanup
uv_fs_rmdir
uv_fs_scandir
uv_fs_scandir_next
uv_fs_sendfile
uv_fs_stat
uv_fs_symlink
uv_fs_unlink
uv_fs_utime
uv_fs_write
uv_get_free_memory
uv_get_process_title
uv_get_total_memory
uv_getaddrinfo
uv_getnameinfo
uv_getrusage
uv_guess_handle
uv_handle_size
uv_has_ref
uv_hrtime
uv_idle_init
uv_idle_start
uv_idle_stop
uv_inet_ntop
uv_inet_pton
uv_interface_addresses
uv_ip4_addr
uv_ip4_name
uv_ip6_addr
uv_ip6_name
uv_is_active
uv_is_closing
uv_is_readable
uv_is_writable
uv_key_create
uv_key_delete
uv_key_get
uv_key_set
uv_kill
uv_listen
uv_loadavg
uv_loop_alive
uv_loop_close
uv_loop_configure
uv_loop_delete
uv_loop_init
uv_loop_new
uv_loop_size
uv_mutex_destroy
uv_mutex_init
uv_mutex_lock
uv_mutex_trylock
uv_mutex_unlock
uv_now
uv_once
uv_os_free_passwd
uv_os_get_passwd
uv_os_homedir
uv_os_tmpdir
uv_pipe_bind
uv_pipe_connect
uv_pipe_getpeername
uv_pipe_getsockname
uv_pipe_init
uv_pipe_open
uv_pipe_pending_count
uv_pipe_pending_instances
uv_pipe_pending_type
uv_poll_init
uv_poll_init_socket
uv_poll_start
uv_poll_stop
uv_prepare_init
uv_prepare_start
uv_prepare_stop
uv_print_active_handles
uv_print_all_handles
uv_process_kill
uv_queue_work
uv_read_start
uv_read_stop
uv_recv_buffer_size
uv_ref
uv_replace_allocator
uv_req_size
uv_resident_set_memory
uv_run
uv_rwlock_destroy
uv_rwlock_init
uv_rwlock_rdlock
uv_rwlock_rdunlock
uv_rwlock_tryrdlock
uv_rwlock_trywrlock
uv_rwlock_wrlock
uv_rwlock_wrunlock
uv_sem_destroy
uv_sem_init
uv_sem_post
uv_sem_trywait
uv_sem_wait
uv_send_buffer_size
uv_set_process_title
uv_setup_args
uv_shutdown
uv_signal_init
uv_signal_start
uv_signal_stop
uv_spawn
uv_stop
uv_stream_set_blocking
uv_strerror
uv_tcp_bind
uv_tcp_connect
uv_tcp_getpeername
uv_tcp_getsockname
uv_tcp_init
uv_tcp_init_ex
uv_tcp_keepalive
uv_tcp_nodelay
uv_tcp_open
uv_tcp_simultaneous_accepts
uv_thread_create
uv_thread_equal
uv_thread_join
uv_thread_self
uv_timer_again
uv_timer_get_repeat
uv_timer_init
uv_timer_set_repeat
uv_timer_start
uv_timer_stop
uv_translate_sys_error
uv_try_write
uv_tty_get_winsize
uv_tty_init
uv_tty_reset_mode
uv_tty_set_mode
uv_udp_bind
uv_udp_getsockname
uv_udp_init
uv_udp_init_ex
uv_udp_open
uv_udp_recv_start
uv_udp_recv_stop
uv_udp_send
uv_udp_set_broadcast
uv_udp_set_membership
uv_udp_set_multicast_interface
uv_udp_set_multicast_loop
uv_udp_set_multicast_ttl
uv_udp_set_ttl
uv_udp_try_send
uv_unref
uv_update_time
uv_uptime
uv_version
uv_version_string
uv_walk
uv_write
uv_write2




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]





[최초 등록일: ]
[최종 수정일: 1/18/2018 ]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer@outlook.com

비밀번호

댓글 쓴 사람
 




... [31]  32  33  34  35  36  37  38  39  40  41  42  43  44  45  ...
NoWriterDateCnt.TitleFile(s)
11466정성태3/18/20183126개발 환경 구성: 355. 한 대의 PC에서 2개 이상의 DirectX 게임을 실행하는 방법
11463정성태3/15/20183444.NET Framework: 733. 스레드 간의 read/write 시에도 lock이 필요 없는 경우파일 다운로드1
11462정성태3/14/20183854개발 환경 구성: 354. HTTPS 호출에 대한 TLS 설정 확인하는 방법 [1]
11461정성태3/13/20184946오류 유형: 454. 윈도우 업데이트 설치 오류 - 0x800705b4 [1]
11460정성태3/14/20183382디버깅 기술: 112. windbg - 닷넷 메모리 덤프에서 전역 객체의 내용을 조사하는 방법
11459정성태3/13/20182532오류 유형: 453. Debug Diagnostic Tool에서 mscordacwks.dll을 찾지 못하는 문제
11458정성태2/21/20183037오류 유형: 452. This share requires the obsolete SMB1 protocol, which is unsafe and could expose your system to attack.
11457정성태2/17/20184715.NET Framework: 732. C# - Task.ContinueWith 설명파일 다운로드1
11456정성태4/10/20186269.NET Framework: 731. C# - await을 Task 타입이 아닌 사용자 정의 타입에 적용하는 방법 [3]파일 다운로드1
11455정성태2/17/20183620오류 유형: 451. ASP.NET Core - An error occurred during the compilation of a resource required to process this request.
11454정성태2/12/20188345기타: 71. 만료된 Office 제품 키를 변경하는 방법
11453정성태1/31/20182653오류 유형: 450. Azure Cloud Services(classic) 배포 시 "Certificate with thumbprint ... doesn't exist." 오류 발생
11452정성태1/31/20185538기타: 70. 재현 가능한 최소한의 예제 프로젝트란? [3]
11451정성태1/24/20183202디버깅 기술: 111. x86 메모리 덤프 분석 시 닷넷 메서드의 호출 인자 값 확인
11450정성태11/15/20188985Windows: 146. PowerShell로 원격 프로세스(EXE, BAT) 실행하는 방법
11449정성태3/6/20184528오류 유형: 449. 단위 테스트 - Could not load file or assembly 'Microsoft.VisualStudio.QualityTools.VideoRecorderEngine' or one of its dependencies. [1]
11448정성태1/20/20183106오류 유형: 448. Fakes를 포함한 단위 테스트 프로젝트를 빌드 시 CS0619 관련 오류 발생
11447정성태1/20/20183501.NET Framework: 730. dotnet user-secrets 명령어파일 다운로드1
11446정성태1/20/20183445.NET Framework: 729. windbg로 살펴보는 GC heap의 Segment 구조파일 다운로드1
11445정성태1/20/20183018.NET Framework: 728. windbg - 눈으로 확인하는 Workstation GC / Server GC
11444정성태9/13/20183760VS.NET IDE: 125. Visual Studio에서 Selenium WebDriver를 이용한 웹 브라우저 단위 테스트 구성파일 다운로드1
11443정성태1/18/20183896VC++: 124. libuv 모듈 살펴 보기
11442정성태1/18/20182768개발 환경 구성: 353. ASP.NET Core 프로젝트의 "Enable unmanaged code debugging" 옵션 켜는 방법
11441정성태1/18/20182927오류 유형: 447. ASP.NET Core 배포 오류 - Ensure that restore has run and that you have included '...' in the TargetFrameworks for your project.
11440정성태1/17/20183358.NET Framework: 727. ASP.NET의 HttpContext.Current 구현에 대응하는 ASP.NET Core의 IHttpContextAccessor/HttpContextAccessor 사용법파일 다운로드1
11439정성태8/25/20187332기타: 69. C# - CPU 100% 부하 주는 프로그램파일 다운로드1
... [31]  32  33  34  35  36  37  38  39  40  41  42  43  44  45  ...