473,324 Members | 2,179 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

socket.sendfile question (or general file transfer)

djc
the system.net.sockets.socket class has the 'sendfile' method. What do you
do on the other end to 'receive' the file? I know the regular socket.receive
will receive the data into a buffer (a byte array) but if that is how you
are supposed to receive the file how do you make it 'the file' again? Lets
say I send over a text file, or a binary file, or whatever, how does it get
back to its original format? Or am I way off base to begin with? should I be
using something else to send files in a client server or peer to peer type
setup?

any input on this would be greatly appreciated. Thanks.
Feb 15 '06 #1
1 1580
IIRC SendFile after transferring file will close the connection. Also you
can specify prefix and suffix data for the file. This tokens can be detected
on the remote host.

In the prefix data you can specify file name and file size so that remote
host could save the file.

Another way is to define your custom protocol where you will specify file
name and send file using common Send

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com

"djc" <no***@nowhere.com> wrote in message
news:ut**************@TK2MSFTNGP14.phx.gbl...
the system.net.sockets.socket class has the 'sendfile' method. What do you
do on the other end to 'receive' the file? I know the regular
socket.receive
will receive the data into a buffer (a byte array) but if that is how you
are supposed to receive the file how do you make it 'the file' again? Lets
say I send over a text file, or a binary file, or whatever, how does it
get
back to its original format? Or am I way off base to begin with? should I
be
using something else to send files in a client server or peer to peer type
setup?

any input on this would be greatly appreciated. Thanks.

Feb 15 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: GrantS | last post by:
I need urgent help. Done OK for a newbie getting automation of Windows Messenger into a Winform C# app but have three problems that I urgently need pointers to. Point 1 and 2 are the same issue, I...
1
by: lkr | last post by:
hi i got one file transfer program using serialization which has a limitation that i can send only 8192 bytes(8KB). i want to send more than that wht can i do. how can i divide the file into...
2
by: Bonzol | last post by:
vb.net 2003 Windows application We have a Client/Server system set up by communicating through a TCPClient object. The server loops continuously using a tcplistener device and each time a client...
0
by: iwdu15 | last post by:
hi, ive done work with sockets and such before, so its nothing new. thought id try the Socket.SendFile() method instead of the manual way. however, there is no Socket.ReceiveFile() method. How do...
0
by: Matt | last post by:
Hi all, Probably a silly mistake, but I seem to be losing 24 bytes every time I attempt to send a file using Socket.SendFile(). Here is my code: Here is the server method: void...
10
by: David | last post by:
I have googled to no avail on getting specifically what I'm looking for. I have found plenty of full blown apps that implement some type of file transfer but what I'm specifcally looking for is an...
5
by: raghubr | last post by:
Hi all, Can any one pls guide me through..I need to transfer the file from server to client and client to server using sockets in an Asynchronous mode so this file transfer doesn't hinder the...
1
by: Saurabh | last post by:
Dear All, Can anyone tell me, how to write such a program that can transfer files (either binary or text) behind NAT devices( such as for computers behind firewalls and routers and other NAT...
2
by: kashifjawed | last post by:
I'm developing a c# asynchronous socket application for tranfering file or large data from client to server and server to client as well in chunks. Application sometimes transfer file from client...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.