LogoLogo
English
English
  • Diarkis Help Center
  • Overview of Diarkis
  • Getting Started
    • Diarkis Server Template
    • Diarkis Client SDK
    • Tutorials
      • 1. Launch Diarkis Server in Local Environment
      • 2. Perform Connectivity Check with Test Client
      • 3. Implement Custom Command
      • Connect to Server from Diarkis Client
    • Samples
  • Diarkis Modules
    • Room Module
      • Set Up Room Module on Server
      • Room Sample
        • room_broadcast
      • Utilizing Room Module from Client
      • Additional Features of Room
    • MatchMaker Module
      • Set Up MatchMaker Module on Server
    • Field Module
      • Set Up Field Module on Server
    • P2P Module
      • Set Up P2P Module on Server
      • P2P Sample
    • DM (Direct Message) Module
      • Set Up DM Module on Server
    • Notifier Module
      • Set Up Notifier Module on Server
    • Session Module
      • Set Up Session Module on Server
    • Group Module
      • Set Up Group Module on Server
  • Diarkis Server
    • Launch Diarkis Server in Cloud Environment
      • AWS
    • Launch Diarkis Server on Windows Environment
    • MARS Server
    • UDP Server
    • TCP Server
    • HTTP Server
    • Metrics API
    • Inter-server Communication - Mesh
  • Diarkis Client
    • Runtime Library
      • Diarkis RUDP
    • Diarkis Module
      • Initialization and Termination of Diarkis Module
      • Customization of Diarkis Module
      • Logging System of Diarkis Module
      • Migration
      • Threads of Diarkis
    • Samples
      • C++
        • room_broadcast
        • directmessage_simple
        • group_sample
        • matching_and_turn
        • matchmaker_ticket
        • p2p_rudp_sample
        • session_simple
      • Unreal Engine Plugin
        • FieldWalker
      • Unity Plugin
        • FieldWalker
          • HowToReplicatePosition.md
  • Diarkis Tools
    • Diarkis CLI
      • Procedures to Switch to Diarkis CLI v3
  • References
    • API Reference
    • Release Notes
      • v1.0
      • v1.0.1
      • v1.0.2
      • v1.0.3
      • v1.0.4
      • v1.0.5
      • v1.0.6
  • Support
    • License and Billing
Powered by GitBook
On this page
  • Introduction
  • Windows Environment
  • macOS Environment
  • Linux Environment

Was this helpful?

  1. Getting Started
  2. Tutorials

Connect to Server from Diarkis Client

Previous3. Implement Custom CommandNextSamples

Last updated 1 month ago

Was this helpful?

Introduction

This page explains how to connect to and communicate with a Diarkis server, started using the "Starting a Diarkis Server Locally" guide, using the C++ room_broadcast sample. In the room_broadcast sample, a virtual room is created on the Diarkis server using the Room module, allowing two users to connect and exchange data with each other. For a detailed explanation of the sample, please refer to .

Windows Environment

  1. Open samples/room_broadcast/win-x64/room_broadcast.sln in Visual Studio.

  2. Specify the command arguments under Project > Properties > Debugging.

     $(endPoint) $(uid) $(clientKey) 
     Example: 127.0.0.1:7000 1111 AAAA
  3. Build and launch the program with F5. Once the sample program starts, and upon connecting to the Diarkis server, the following log will be displayed:

    Start
    FileLoggerBackend created files ./logs/1111/diarkis-log.log
    ============================
    Loop=1
    Endpoint: 127.0.0.1:7100
    UID     : 1111
    
    Connecting to the UDP server...
    Connected
    Joining a room...
    Joined
    Room members: 1111

    The room_broadcast sample waits for multiple users to connect to the room before proceeding with the sample processes. If only one user connects, the program will wait for other users to connect.

  4. Run multiple clients as separate processes from a Windows terminal (command prompt), etc. The executable is output to samples/room_broadcast/win-x64/x64/Debug/bin/room_broadcast.exe.

    > ./x64/Debug/bin/room_broadcast.exe $(endPoint) $(uid) $(clientKey)
    Example: room_broadcast.exe 127.0.0.1:7000 2222 BBBB

    When two users connect to the Diarkis server, the following log is displayed, confirming that data transfer through the Room module of the Diarkis server is taking place.

    Connecting to the UDP server...
    Connected
    Joining a room...
    Joined
    Room members: 1111, 2222
    Room Broadcast
    Stats Room Broadcast num 100
    Stats Room Broadcast num 200
    Stats Room Broadcast num 300

macOS Environment

Coming Soon

Linux Environment

Coming Soon

room_broadcast