᲼᲼᲼᲼᲼᲼᲼᲼(Dicky)
᲼᲼᲼᲼᲼᲼᲼᲼(Dicky)
CC#
Created by ᲼᲼᲼᲼᲼᲼᲼᲼(Dicky) on 3/30/2023 in #help
❔ implementing licensing system in my app
Hi guys, I would like to implement some kind of license system to my app written in c#. I've been considering APIs like keyauth.cc...but can you maybe recommend something better? What do you use in your apps? Thanks for the answer in advance
5 replies
CC#
Created by ᲼᲼᲼᲼᲼᲼᲼᲼(Dicky) on 10/4/2022 in #help
read TCP stream issue
Hi, Maybe you will be able to give me some tips 😅 I am writting a tool using already created API. The creator of the api doesn't know c# so he isn't able to help me with that issue (API is written in C++ but it should work fine with c# too). In short - tool sends json messages using TCP socket. Messages are terminated with '\1' character or 0x01 byte (so one "packet" can in fact be stored in 2 <or more> messages received from a bot). and this is the part I have no idea how to handle. I wrote something like that:
//function to receive messages from tcpserver
while (true)
{
byte[] numArray = new byte[TCPClient.ReceiveBufferSize + 1];
TCPClientStream.Read(numArray, 0, TCPClient.ReceiveBufferSize);
string[] msg = Strings.Split(Encoding.UTF7.GetString(numArray), "\u0001");
...
later json deserialize etc
}
//function to receive messages from tcpserver
while (true)
{
byte[] numArray = new byte[TCPClient.ReceiveBufferSize + 1];
TCPClientStream.Read(numArray, 0, TCPClient.ReceiveBufferSize);
string[] msg = Strings.Split(Encoding.UTF7.GetString(numArray), "\u0001");
...
later json deserialize etc
}
but it's not reading packets which are stored in more than one tcp message. do you have any ideas how can I fix that? I made a tool with QT and c++..and ok. it works fine. but I personally hate c++ and "upgrading" this tool is a horror for me. With C# it seems to be not reading part of the messages, which should be handled. I checked that and seems to be missing about 30% of the packets. There is no official c# api...but this kind of api should be possible to work with any language which supports JSON and TCP sockets. thanks for any tip in advance and have a nice day!
21 replies