-
February 24th, 2011, 06:04 PM
#1
Receive file sended with TransmitFile()
Hi Everybody,
The MSDN shows how to use the API TransmitFile() to send a file over a conneciton-oriented socket.. but it does not show you how to receive it!
Is it done with the recv function or is it done in any other way?
I want this becouse I'm making a chat program. By now it is a frame with a menubar with two (useful, there are more non-useful) entries. Both options creates a child window, but server option sets up a server, and client options conects to a server.
I'm a bit strucked in the function of sending and receiving files. So any help is wellcome
-
March 2nd, 2011, 11:50 AM
#2
Re: Receive file sended with TransmitFile()
AFAIK, you can use receive() function to receive file data. The TransmitFile() is just an optimized sending function in sender side.
henky
----------------------------------
henky@nok.co.id is not my email address anymore...
Jangan Pernah Menyerah
-
March 3rd, 2011, 10:19 AM
#3
Re: Receive file sended with TransmitFile()
Originally Posted by henky@nok.co.id
AFAIK, you can use receive() function to receive file data. The TransmitFile() is just an optimized sending function in sender side.
Ok, but another question, Is there a function to know when it's a file and not text? and How to rebuild the file on the receiver side?
-
March 4th, 2011, 05:07 AM
#4
Re: Receive file sended with TransmitFile()
Originally Posted by pedro00pedro
Ok, but another question, Is there a function to know when it's a file and not text? and How to rebuild the file on the receiver side?
You have to build a mechanism (protocol) so the receiver knows received data has to be saved into file.
To rebuild the file, just save all receive data into file, but as i mention above, you have to build a mechanism how to transfer the file. The good example may be FTP protocol.
henky
----------------------------------
henky@nok.co.id is not my email address anymore...
Jangan Pernah Menyerah
-
March 4th, 2011, 05:17 AM
#5
Re: Receive file sended with TransmitFile()
I forgot to tell you. There is no function to know received data is a file data or just a text.
I suggest you to see RFC959 (File Transfer Protocol) as an example.
http://datatracker.ietf.org/doc/rfc959/
henky
----------------------------------
henky@nok.co.id is not my email address anymore...
Jangan Pernah Menyerah
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|