How to receive data from HarkDataStreamSender

HARK FORUM How to receive data from HarkDataStreamSender

This topic contains 9 replies, has 3 voices, and was last updated by Avatar kohira 3 weeks, 1 day ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1115
    Avatar
    kohira
    Participant

    I’m trying to receive data that HarkDataStreamSender sends.

    But after accept() is succeeded in my server, recv() receives a data of size zero, and connection is closed by client (i.e. HarkDataStreamSender).

    Is there any sample source code for server receiving data send by HarkDataStreamSender?

    Or, is there source code for HarkDataStreamSender?

    Thank you.

    #1121

    Sample code is not provided from the official website, but specifications and source code are available. I hope you find it helpful.
    There is only one point to note. Since the data is transmitted in little endian, it is not in the network byte order generally called.

    Please refer to the next url for specifications.
    https://www.hark.jp/document/hark-document-en/subsec-HarkDataStreamSender.html

    The source code can be obtained with the following command on Ubuntu.
    apt source hark-core

    In the case of Windows environment, it is probably easy to download from the following URL.
    http://archive.hark.jp/harkrepos/dists/bionic/non-free/source/
    You can download any version by clicking the following file name on the browser. The <version> will be in the form of “x.x.x”.
    hark-core_<version>.tar.gz

    Best regards,
    m.takigahira

    #1204
    Avatar
    kohira
    Participant

    Hi,

    For receiving data from HarkDataStreamSender, I made a TCP server.
    A fragment of source code of the server is as below.

    sock = accept(sock0, (struct sockaddr*) & client, &len);
    int sz = recv(sock, pbuff, szbuff, 0);

    Just after executing HARK network the server accepts something, but recv() is blocked, i.e., no data coming.

    Is my connection on HarkDataStreamSender wrong? or other mistakes?
    Could you please tell me wrong point?

    Thank you.
    Kohira

    Attachments:
    #1207
    Avatar
    lapus.er
    Participant

    Hi kohira,

    It is difficult to spot the problem using just the code snippet that you sent because it provides very little context to flow of the program.

    Can you please attach the entire file?

    Cheers,
    HARK Support Team.

    #1213
    Avatar
    kohira
    Participant

    Hi,

    I attached an network file, in which I place HarkDataStreamSender in sub_separation to send data to external server. And version is 3.0.0.

    Thank you.
    Kohira

    #1215
    Avatar
    lapus.er
    Participant

    Hi,

    Can you also share the source code of the server? I would like to check the source code and at the same time replicate the problem that you described.

    Cheers,
    HARK Support Team

    • This reply was modified 3 weeks, 3 days ago by Avatar lapus.er.
    #1217
    Avatar
    kohira
    Participant

    Hi,

    It is very appreciated if you point out wrong portion.

    Attached are server for HARK and client for testing the server. I am using Visual Studio 2019.

    Thank you.

    #1218
    Avatar
    kohira
    Participant

    Try to upload as zip file.

    Attachments:
    1. svr4hark.zip
    #1220
    Avatar
    lapus.er
    Participant

    Hi kohira,

    I built svr4hark.cpp and ran the network and I was able to reproduce your issue – it can accept() successfully but no data is coming in. I checked the source code and it looks to me that there is nothing wrong with it. I think that no data was being sent from the HarkDataStreamSender node.

    I will review the network file with the team, and check why no data is being sent to the server.

    Cheers,
    Earl

    #1221
    Avatar
    kohira
    Participant

    Hi Earl,

    I DO thank you and your team! It would be very appreciated if the server receive data.

    Thank you.
    Kohira

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.