Re: File transfer



Thanks for the reply,
I have done the same thing, i send the size first and initialize the
byte array of that size,
but still it doesn't works.
I am having the chat server application on a server that is situated in
US and i am
running the client app from here in India.
Does the Internet connection creates any problem?



Ciaran O''Donnell wrote:
You might have a problem with not all the data being sent. Are you flushing
the socket after writing everything. I have implemented a system similar
before but I had a control channel setup which enabled me to inform the
reciever first of the total number of bytes in the file. I was then able to
wait till they all arrived but they didn't until the sender flushed.

HTH

Ciaran O'Donnell

"Pramod" wrote:

Hi all,
I have created a chat application, and one of it's functionality to
send files to the connected user.
I read the contents of the files into a Byte array and send that
through sockets.
Now when i send a file of 150 kb size the file seems to be corrupted at
the receivers end.
some part of the file is not received.
Is there any restriction of size for sending files across internet
using sockets?

I am able to send small files without any problem.
When i run the same application locally, i am able to send huge files
of 3-4 MB easily.

Can anyone point out why this is happening?



.



Relevant Pages

  • Re: Can I use a byte array for sound files?
    ... Sound and sockets are off-topic in comp.lang.c but there are some ... You can read *ANY* readable file into a byte array (well, ... of data from the keyboard, and disk files, but it may be a bit more ...
    (comp.lang.c)
  • Re: socket programming
    ... > using sockets we exchange text between endpoints of the socket but ... > first we convert the text to array of bytes and we send it to the other ... For sending a binary integer to an endpoint, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: convert fd to IO object in extension?
    ... >>network sockets and disk file I/O. ... Caller creates an instance of Epoll ... add the IO object to a Hash and also call epoll_ctlto add ... that returns, builds an array of 2-cell arrays, the first cell containing ...
    (comp.lang.ruby)
  • Re: size limit for byte array?
    ... Sockets are streaming in nature, and while you might create a 16KB byte ... array on one end and send off using 1 statement, ... Instead of breaking the loop on "less than full buffer", ... on "empty buffer". ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Datagrid number sorting
    ... of my data just to do that, the data set in the array is already big ... to know its being passed a number instead of a string. ... Ciaran O''Donnell wrote: ... Then you can bind the grid to the datatable and do sorting and filtering on ...
    (microsoft.public.dotnet.framework.windowsforms)

Loading