I wonder if it is possible to transmit 1GB file...

hycheon4004
edited August 2011 in DotNet
when I try to send a png file(227KB) through UDP, I get QueueOutgoingReliableWarning.
I want to know what the problem is and How can I solve it so that I can transmit 1GB file to other players.
Could you help me?

following shows how i tried...
BinaryReader br = new BinaryReader(fs);
int length = (int)br.BaseStream.Length;
byte[] buf = new byte[length + 1];
buf = br.ReadBytes(length);
br.Close();
fs.Close();
Hashtable evt = new Hashtable();
evt.Add((byte)EventKey.msg, buf);
this.peer.OpRaiseEvent((byte)EventCode.checkVer, evt, true);

Comments

  • The warnings are just warnings. You can work-around by setting WarningSize to a higher value.
    However, at 1 GB I suggest that you split it your file into smaller fragments and send them with separate operations.
  • For 1GB I would definitely recommend to not kill your game server at all. instead get it written to a webhost and let the user download it through WWW. Webhosts are better suited at "bruteforce data transmit", if you plaster the game server then the experience for every single user connected will suffer, with 2-3 user requiring this transfer in parallel you will start to see the consequences of the pipe being heavily flooded.

    Also, do you really want high traffic on your expensive game server hosting when webserver offerings cost you 1/10th to 1/1000th per MB traffic (cause they have no latency requirement unlike the game server)
  • Thank you for your helpful responses.
    I'm just having a test for a update-server.
  • If you don't intend to reinvent the wheel here, it most likely makes sense to do updates via regular http traffic.
    There are Content Delivery Networks out there, which make distribution and access relatively simple.
  • According to Performance Tips for Datagram size, operations and events that are bigger than 1200bytes get fragmented and are sent in multiple commands. As I understand, sending much bigger data is ok since Photon will split the data automatically. Am I misunderstanding?
  • No you are right, it will split it, send them in serial manner and build it together.

    But you get an idea how many packets 1GB :D
  • thanks for the quick reply dreamora, and I have one more question.
    Is there a function reading files as binary type in Photon like BinaryReader in C#?
  • According to Performance Tips for Datagram size, operations and events that are bigger than 1200bytes get fragmented and are sent in multiple commands. As I understand, sending much bigger data is ok since Photon will split the data automatically. Am I misunderstanding?
    Your are right, BUT, there is another limit at USHORT_MAX (65536) bytes, including overhead, and this one is per operation, so if you want to send more than that, you will have to split it into multiple operations, yourself.
    thanks for the quick reply dreamora, and I have one more question.
    Is there a function reading files as binary type in Photon like BinaryReader in C#?
    Why not just using BinaryReader therefor?
  • I got it!! Thanks alot :)