gRPC 를 이용한 서비스 sample
아래 과정을 거쳐 project 를 설정하고 실행 가능. 이미 설치 되어있는 component 나 package 가 있다면 skip 가능.
-
개발환경
- 64 bit Windows 10
- Visual studio 2019 16.6.1
- Windows SDK 10.0.18362.0
- .NET core 3.1 SDK
- git 2.22.0
-
C++ client 빌드를 위한 library package 설치
-
vcpkg 설치 ;
git clone https://github.com/microsoft/vcpkg.git
실행 후 powershell 또는 cmd 에서bootstrap-vcpkg.bat
실행 -
protobuf pakcage 설치 ;
.\vcpkg.exe install protobuf:x64-windows
-
gRPC package 설치 ;
.\vcpkg.exe install grpc:x64-windows
-
winsock2 pakcage 설치 ;
.\vcpkg.exe install winsock2:x64-windows
-
관리자 권한으로 pwoershell 혹은 cmd 에서
.\vcpkg.exe integrate install
실행해 visual studio(재시작)에서 사용가능하도록 등록
-
-
visual studio 에서
K2.sln
파일 열기 -
solution 속성 설정(properies)에서
시작 프로젝트
에서 여러개의 시작프로젝트로 설정하고 포함되어있는 모든 프로젝트를 시작으로 설정. -
Run debug
- 사용 가능한 user id - password 는 테스트 계정-비밀번호 참고
-
공용 및 기타
- sample proto ; server 와 client 에게 모두 필요한 protocol(RPC) 정의
- oldHistory
서버가 실행되고 유지되는 Server-server(backend) communication 과정
client 가 최초 연결되고 인증 및 push 연결을 설정하는 과정
단순한 호출(request) - 응답(response) 예시
유저 또는 서버의 요청에 의해 다른 유저에게 데이터를 전송(push)하는 예시