Board index » cppbuilder » Send a file over TCP Socket
mehmed sipahi
![]() CBuilder Developer |
mehmed sipahi
![]() CBuilder Developer |
Send a file over TCP Socket2005-03-07 05:03:48 PM cppbuilder24 Hi how can i send a file over tcp socket connection?I have allredy have a server which receive the file.BUt I dont know how can i sen file from client? Sould i use Socket->Send() method ?but how? Can you give a sample? |
Hans Galema
![]() CBuilder Developer |
2005-03-07 05:05:51 PM
Re:Send a file over TCP Socket
mehmed sipahi wrote:
QuoteHi how can i send a file over tcp socket connection?I have allredy have a Can you send other data ? Please read some actual threads in this newsgroup concerning SendBuf(). Hans. |
Vladimir Stefanovic
![]() CBuilder Developer |
2005-03-07 10:29:03 PM
Re:Send a file over TCP Socket
I think it's the ultimate time that Remy publishes the code
(faq) he presented here many times, and so just redirect all similar questions. I haven't counted but it's maybe 20th time that the same question reappears ;) -- Best regards, Vladimir Stefanovic "Hans Galema" < XXXX@XXXXX.COM >wrote in message Quotemehmed sipahi wrote: {smallsort} |
Vladimir Stefanovic
![]() CBuilder Developer |
2005-03-07 11:56:57 PM
Re:Send a file over TCP Socket
Look at the thread from 11. januar 2005 19:41
'please help me..socket file transfer' -- Best regards, Vladimir Stefanovic "mehmed sipahi" < XXXX@XXXXX.COM >wrote in message QuoteHi how can i send a file over tcp socket connection?I have allredy have a |
Remy Lebeau (TeamB)
![]() CBuilder Developer |
2005-03-08 01:21:45 AM
Re:Send a file over TCP Socket
"Vladimir Stefanovic" < XXXX@XXXXX.COM >wrote in message
QuoteI think it's the ultimate time that Remy publishes the Gambit |
lakis
![]() CBuilder Developer |
2005-03-08 04:11:58 PM
Re:Send a file over TCP Socket
remy's code works perfectly...can you please tell me what changes should be
made in order to see the download speed and how many bytes remain for download?this 2 things i would like to be visible to the client and to the server too.. thank you very much in advance for your help ?"mehmed sipahi" < XXXX@XXXXX.COM >έγραψε στ?μήνυμα QuoteHi how can i send a file over tcp socket connection?I have allredy have a |
Hans Galema
![]() CBuilder Developer |
2005-03-08 05:15:09 PM
Re:Send a file over TCP Socket
lakis wrote:
Quoteremy's code works perfectly... Quotecan you please tell me what changes should be |
lakis
![]() CBuilder Developer |
2005-03-08 06:06:01 PM
Re:Send a file over TCP Socket
as vladimir said remy posted a code for file send over tcp socket
(Look at the thread from 11. januar 2005 19:41 'please help me..socket file transfer')the code works excellent.i place a client socket on one computer and a server socket on another computer and i send file from server to client using that code. what changes should be made to this code in order to see also to the client and to the server side the download speed and the bytes remaining....i can post remys code again if neccessary. ?"Vladimir Stefanovic" < XXXX@XXXXX.COM >έγραψε στ?μήνυμα QuoteLook at the thread from 11. januar 2005 19:41 |
Hans Galema
![]() CBuilder Developer |
2005-03-08 06:38:04 PM
Re:Send a file over TCP Socket
lakis wrote:
Quotewhat changes should be made to this code in order to see also to the client is used to send chuncks of data. So at every moment you know how much is sent. If you use GetTickCount() you know bytes/ms. So you only have to ad some code in that loop. Hans. |
lakis
![]() CBuilder Developer |
2005-03-08 07:02:12 PM
Re:Send a file over TCP Socket
well i understand what u mean,and it seems simple i will work on it.now one
final question and really sorry for the trouble of continuous questions..basically its a rather stupid question but im new in programming.:if i use indy trivial ftp components for file transfer means i am using trivial ftp protocol,if i use indy ftp components for file transfer means i am using ftp protocol etc. when i send file through sockets in this way what protocol am i using?(or im not using any protocol at all?) i mean that trivial ftp,ftp,icmp,http, etc protocols have some security...through sockets which protocol am i using ?(in order to understand what security is provided) ? "Hans Galema" < XXXX@XXXXX.COM >?????? ??? ?????? Quotelakis wrote: |
Hans Galema
![]() CBuilder Developer |
2005-03-09 03:52:29 AM
Re:Send a file over TCP Socket
lakis wrote:
Quote... now one with a kapital letter at the start of a sentence. Is your shift key blocked ? Quoteif i use indy trivial ftp components for file transfer means i Quotewhen i send then it can for instance send four bytes (an int) first with the size of the message. A client has to read that size first. As simple as it is: this is a protocol. You have to know that the size comes first and act accordingly. Hans. |
lakis
![]() CBuilder Developer |
2005-03-09 03:57:38 PM
Re:Send a file over TCP Socket
Well basically i use the Caps Lock istead of the shift key..:)).By the way
ftp and trivial ftp are diffrent things FTP:FTP is commonly run on two ports, 20 and 21. Port 20 is a data stream which transfers the data between the client and the server. Port 21 is the control stream and is the port where commands are passed to the ftp server.FTP is an 8-bit client-server protocol, TRIVIAL FTP:Trivial File Transfer Protocol (TFTP) is a very simple file transfer protocol akin to a basic version of FTP a.. Uses UDP (port 69) as its transport protocol (unlike FTP which uses TCP port 21). b.. It cannot list directory contents c.. No authentication or encryption mechanisms d.. Used to read files from/write files to a remote server e.. Supports three different transfer modes, "netascii", "octet" and "mail", with the first two corresponding to the "ascii" and "image" (binary) modes of the FTP protocol. from en.wikipedia.org/ so ftp and trivial ftp arent exactly the same protocols, are they? ? "Hans Galema" < XXXX@XXXXX.COM >?????? ??? ?????? Quotelakis wrote: |
lakis
![]() CBuilder Developer |
2005-03-09 03:59:22 PM
Re:Send a file over TCP Socket
and also tftp:Standard 33/RFC 1350
(www.rfc-editor.org/rfc/std/std33.txt) "The TFTP protocol (revision 2)" insteed of ftp:The protocol is standardized in RFC 0959 by the IETF ? "Hans Galema" < XXXX@XXXXX.COM >?????? ??? ?????? Quotelakis wrote: |
Hans Galema
![]() CBuilder Developer |
2005-03-09 04:00:00 PM
Re:Send a file over TCP Socket
lakis wrote:
QuoteBy the way Hans. |