Re: Reading data from the network without knowing the size of the buffer that is coming

2019-03-22 Thread Vladimir Panteleev via Digitalmars-d-learn
On Thursday, 21 March 2019 at 16:54:01 UTC, Roman Sztergbaum wrote: I would like to get rid of the "ubytes[256]" because I do not know the size of the data that is comming, I would like to read the entire buffer that I send at once. Can someone point me? If you do not know the size of the

Re: Reading data from the network without knowing the size of the buffer that is coming

2019-03-21 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 21 March 2019 at 18:27:56 UTC, Andre Pany wrote: If the data received is smaller than 256 bytes, the array will contain NULL (character 0 value in the ascii table). This you might could use as indicator you received all values. That's wrong, the correct thing to check is the

Re: Reading data from the network without knowing the size of the buffer that is coming

2019-03-21 Thread Roman Sztergbaum via Digitalmars-d-learn
On Thursday, 21 March 2019 at 18:27:56 UTC, Andre Pany wrote: On Thursday, 21 March 2019 at 16:54:01 UTC, Roman Sztergbaum wrote: [...] I am also not a expert in this area. If the message received from the server exceeds 256 bytes, you have to call the receive message several times until

Re: Reading data from the network without knowing the size of the buffer that is coming

2019-03-21 Thread Andre Pany via Digitalmars-d-learn
On Thursday, 21 March 2019 at 16:54:01 UTC, Roman Sztergbaum wrote: Hello ! in my function : ```D private config_load_answer load_config(string[] args) in(args !is null, "args cannot be null") in(args.length == 2, "need 1 arguments") out(r; r.state == "SUCCESS", "load_config

Reading data from the network without knowing the size of the buffer that is coming

2019-03-21 Thread Roman Sztergbaum via Digitalmars-d-learn
Hello ! in my function : ```D private config_load_answer load_config(string[] args) in(args !is null, "args cannot be null") in(args.length == 2, "need 1 arguments") out(r; r.state == "SUCCESS", "load_config should succeed") out(r; !r.config_name.empty, "config_name should not