« first day (2800 days earlier)      last day (1302 days later) » 

12:23 AM
@JBis

i made tcp server with nodeJs and c# client
how i send buffer like this

function writeInt(stream, int){
var bytes = new Array(5)
bytes[0] = 2
bytes[1] = int >> 24
bytes[2] = int >> 16
bytes[3] = int >> 8
bytes[4] = int
bytes[5] = 0


stream.write( Buffer.from(bytes))
}




i send the header ifrst and then send the buffer


var buf = Buffer.from("HELLO THIS IS A MESSAGE FROM SERVER");
writeInt(sock, buf.length)
sock.write(buf);
 
1 message moved from JavaScript
@MohamedMohamed Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
1 message moved from JavaScript
 
            @JBis

            i made tcp server with nodeJs and c# client
            how i send buffer like this

            function writeInt(stream, int){
            var bytes = new Array(5)
            bytes[0] = 2
            bytes[1] = int >> 24
            bytes[2] = int >> 16
            bytes[3] = int >> 8
            bytes[4] = int
            bytes[5] = 0


            stream.write( Buffer.from(bytes))
            }




            i send the header ifrst and then send the buffer
 
3 messages moved from JavaScript
 
 
4 hours later…
 
3 hours later…
 
4 hours later…
 
1 hour later…
 
3 hours later…
 
1 hour later…
 
2 hours later…
8:11 PM
1 message moved from JavaScript
1 message moved from JavaScript
 
 
1 hour later…

« first day (2800 days earlier)      last day (1302 days later) »