Error when sending big file in opRaiseEvent
Options
I read file into byte[] and put it in the Hashtable before sending it using opRaiseEvent(). It works fine when I send the small file (like smaller than 50KB), but this error keeps giving out when I send a relatively big file (like more than 1MB). I think it may be some buffer size issue, but is there any way I can send the big file using some existing methods and parameters?
Thanks! The error message is as below:
Thanks! The error message is as below:
DebugReturn:System.Net.Sockets.SocketException: A non-blocking socket operation could not be completed immediately at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, So cketFlags socketFlags) at ExitGames.Client.Photon.NConnect.SendUdpPackage(Byte[] data, Int32 length) at ExitGames.Client.Photon.EnetPeer.sendData(Byte[] data, Int32 length) System.Net.Sockets.SocketException: A non-blocking socket operation could not be completed immediately at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, So cketFlags socketFlags) at ExitGames.Client.Photon.NConnect.SendUdpPackage(Byte[] data, Int32 length) at ExitGames.Client.Photon.EnetPeer.sendData(Byte[] data, Int32 length) at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, So cketFlags socketFlags) at ExitGames.Client.Photon.NConnect.SendUdpPackage(Byte[] data, Int32 length) at ExitGames.Client.Photon.EnetPeer.sendData(Byte[] data, Int32 length)
0
Comments
-
Hi billTCP,
a little search in our forum let me find this: http://forum.exitgames.com/viewtopic.php?f=5&t=1530&p=7166&hilit=max#p7166
As you can see, it is not recommended to send data-chunks of this size, as photon is optimized for fast data transfer of game relevant data, which is mostly a lot smaller. May be you should consider another way for filetransfer.
thx
Tim0 -
Filetransfer is not the best use of Photon and to be honest: any http server can do that, is easier to loadbalance and much more cost-effective really.
Try to separate out the file downloads and let Photon handle the realtime in-game communication exclusively. What you send in Photon should usually be small and needed quickly. Also, Photon does not support insight into load-progress.0 -
I know it's not a good idea to use photon to work as a ftp tool, but since I require only a simple C/S structure with the basic "usable" function of sending messages and data, without considering the efficiency and server burden too much, I think it would be OK if photon can accomplish this task even if it may be a little slow(I am not developing a FPS game)...
So if I plan to use photon to transfer big file, should I segment the file into pieces in the client codes, and send the files with chunks not larger than 32K (read from Tim's link) ?
Thanks!0