[Solved] differences of n in TCP and UDP?

Both read and write return the number of bytes read/written, or -1 on error. Note, that to be able to invoke read/write on a UDP socket (or, more generally, on a datagram socket) you have to invoke connect on it beforehand to specify the peer address. 1 solved differences of n in TCP and UDP?

[Solved] Read specific number of bytes which is in acceptable data

Try using this: package main import ( “encoding/binary” “io” ) func ReadPacket(r io.Reader) ([]byte, error) { lenB := make([]byte, 4) if _, err := r.Read(lenB); err != nil { return nil, err } //you can use BigEndian depending on the proto l := binary.LittleEndian.Uint32(lenB) packet := make([]byte, l) _, err := r.Read(packet) return packet, err … Read more

[Solved] How to build a TCP server with erlang?

Check this thing out : TCP Server But I would recommend you to start with gen_tcp and gen_udp modules first before getting started with OTP framework to design your server/Client. Happy Erlang Coding 🙂 solved How to build a TCP server with erlang?