Connect to Server from Diarkis Client

Introduction

This page explains how to connect and communicate with a Diarkis server that has been started in your local environment using the C++ room_broadcast sample. The room_broadcast sample uses the Room module to create a virtual room on the Diarkis server, allowing two users to connect and send/receive data to each other. For a detailed explanation of the sample, please refer to room_broadcast.

Windows Environment

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

  2. Specify the command arguments in Project > Properties > Debug:

    $(endPoint) $(uid) $(clientKey) Example: 127.0.0.1:7000 1111 AAAA
  3. Build and run the program with F5. After starting the sample program and 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 is designed to wait for multiple users to connect to the room before proceeding with the sample processing. Therefore, if only one user connects, it will wait for other users to connect.

  4. Execute multiple clients in separate processes from a Windows terminal (Command Prompt), etc. The executable file 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 output, confirming that data is sent and received through the Diarkis server's Room module.

    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

Last updated