HARK FORUM › How to receive data from HarkDataStreamSender
August 16, 2019 at 1:37 pm #1115
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.August 16, 2019 at 5:25 pm #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.
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.
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”.
m.takigahiraOctober 17, 2019 at 1:25 pm #1204
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?
Attachments:October 21, 2019 at 3:21 pm #1207
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?
HARK Support Team.October 24, 2019 at 9:37 am #1213
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.
Attachments:October 29, 2019 at 1:01 pm #1215
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.
HARK Support Team
October 29, 2019 at 3:11 pm #1217
- This reply was modified 3 weeks, 3 days ago by lapus.er.
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.October 29, 2019 at 3:14 pm #1218October 31, 2019 at 5:56 pm #1220
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.
EarlOctober 31, 2019 at 6:01 pm #1221
I DO thank you and your team! It would be very appreciated if the server receive data.
You must be logged in to reply to this topic.