do:
go tcpConn.write(data1); // 1
go tcpConn.write(data2); // 2
go tcpConn.write(data3); // 3
go tcpConn.write(data4); // 4
Will they reach the receiving end one after another? Or It's possible that their data conflict with one another but that's the role of tcp to handle that?
I don’t think this is a good idea. AFAIK concurrent access to a socket must be synchronized
So do you know how Telegram handles both text and file transmit? Is it happening on one port or they use several ports? because here it's possible to send a text message while a file is uploading
there’s only 0 and 1 being transmitted over the wire.. text is binary data too you just take UTF-8 text and turn it into []byte
and this is called “multiplexing”
So this multiplexing frames the data in a way that the server understands which bytes belong to the text message and which to the file. Sounds tough lol.
Thanks, you saved me from observing open source Russian code lol
Обсуждают сегодня