Capacity of the plugin channels

Hi,

I’m currently thinking about the communication between my plugin and my mod. I would like to know if this is a good idea to upload a file through the plugin channel system or I should use my own way to exchange files between the server and the client?

Hmm… Well it’s just using the MC packet system, so I don’t see why not. All you need is a byte array representation of your file.

I’m not actually sure if there’s some inherent maximum size for the channels system, so I’ll leave that for someone else to answer.

The vanilla packet allows up to 0x100000 (2**20, 1048576) which is a 20-bit integer

However, in Forge, Forge allows more data to be sent using a multipart packet (over the channel FML|MP), in this case, Forge will send multiple S3FPacketCustomPayload packets and reconstruct on the other side.
This mulitpart packet allows for a maximum of 4278169680 bytes (I got this from FMLProxyPacket.MAX_LENGTH) however it will only work for Forge <–> Forge server communication (this includes SpongeForge)

I would not suggest sending large files as this could block the network for a short time while the data is written/read and processed. But IDK if it’s a problem as I’ve never had a mod send a large chunk of data at a time.

Thanks for the reply, the files uploaded through the network are small(less than 1mb), I don’t think that will block the network.

Thanks @simon816.