Hi,
are there any limits how much can be sended via TCP-stream?
I can send files to a size somewhere around 120 kb. If my file
is bigger I receive a file filled with 0-bytes.
are there any limits how much can be sended via TCP-stream?
I can send files to a size somewhere around 120 kb. If my file
is bigger I receive a file filled with 0-bytes.
' used for sending Method Filecopy(name:String, stream:TTCPStream) 'sends a complete file ' DOES NOT work with files >~100 kb Local size:Long = FileSize(name) ' send file size DebugLog ("Filesize:" + size) WriteLong(stream, size) stream.SendMsg() Local fstream:TStream = OpenFile(name) While Not Eof(fstream) b:Byte = ReadByte(fstream) WriteByte (stream, b) Wend stream.SendMsg() CloseFile(fstream) End Method ' used for receiving Method ReceiveFileFromHost(filename:String, stream:TTCPStream) ' DOES NOT work with files >~120 kb Local stringlen:Long While Not stringlen stringlen = stream.RecvAvail() Wend stream.RecvMsg() ' receive the long with filesize Local fsize:Long = stream.ReadLong() Delay 1000 stream.RecvMsg() DeleteFile(filename) CreateFile(filename) Local out:TStream = OpenFile(filename) Local count:Long For count = 1 To fsize ' If stream.RecvAvail() ' another part of file is coming in 'stream.RecvMsg() Local b:Byte = ReadByte(stream) WriteByte(out, b) ' End If Next DebugLog ("File complete") out.Close() 'stream.Close()