Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

can u help me about socket programming ?

Status
Not open for further replies.

tomshack

Junior Member level 3
Junior Member level 3
Joined
Mar 4, 2006
Messages
27
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,474
the below is my homework about socket programming;can anyone help me about it ?please help me ...


The Problem:

"You can implement this program in any programming language."

Your task for this programming assignment is to create an application that
communicates across the Internet using sockets interface to the TCP/IP
protocol. You will create a simple File Transfer Protocol (FTP) client
application that connects to a remote computer and copies all the files
from a specified directory on the remote system to a specified directory
on the local system.

The FTP protocol specifies how an FTP client contacts an FTP server and
the control messages that are exchanged between the client and server. A
full implementation of FTP would allow the user to perform the following
tasks:

-login to the FTP server
-establish connections to transfer files
-download and upload files

To write this program you will first need to become familiar with the FTP
protocol. This protocol is completely specified in RFC 959. You only need
to implement the portions of the FTP protocol that are necessary to
download all the files in the directory specified by the user. The
sections of RFC 959 relevant to this assignment are specified below.

--------------------------------------------------------------------------------

The program shall be called sftp (Simplified FTP), and shall accept the
following command line arguments:

The name of the remote FTP server (e.g., ftp.gnu.org) or its IP address
(e.g., 199.232.41.7). This argument is required.

The directory on the remote FTP server from which you will transfer files
(the source directory). This argument is optional, and if not provided,
sftp should default to the login directory.
The directory on the local host to which you will transfer file (the
destination directory). This argument is optional, and if not provided,
sftp should default to the current working directory.
If only one directory name is provided, your program should assume it to
the the source directory on the remote server (the second argument).

Examples:


sftp ftp.gnu.org pub my_pub
transfers all of the files from the 'login directory'/pub directory at
ftp.gnu.org to a local directory called my_pub.
sftp ftp.gnu.org pub
transfers all of the files from the 'login directory'/pub directory at
ftp.gnu.org to the working directory on the local system.
sftp ftp.gnu.org
transfers all of the files from the login directory at ftp.gnu.org to the
working directory on the local system.


Your program must print nothing but a one-line status report at termination:
If the transfer is successful, the report should be: OK: XXX bytes copied,
specifying the total number of bytes copied, without leading zeros or
spaces
If an error occurs, the report should be: ERROR: followed by some
meaningful error message. If you received an error response across the FTP
control connection, you should use the complete ftp error response
message. Using just the ftp error code for that error is acceptable as
well. Refer to section 4.2 of RFC 959 for the various error codes.
For example:
OK: 12345 bytes copied
ERROR: 530 Login incorrect.


If your program terminates successfully, it should return a result of 0.
Otherwise, it should return a result of 1.
Your program should terminate on any unexpected response across the FTP
control connection, any network error across either connection, a file
write error, etc. In this case, you should issue an error message at
termination in the format specified above. Your program is not expected to
remove files from partially completed transfers.
 

i am not sure, but u can try using java, but u must have some basic object oriented concepts...it isn't hard at alllllll...don't worry, try reading in "core java"
 

salma ali bakr said:
i am not sure, but u can try using java, but u must have some basic object oriented concepts...it isn't hard at alllllll...don't worry, try reading in "core java"

i dont know java,i can do this in c.please i need more help..
 

if you are going to use java you ahve to go through the api, there is a class called connector and all the subclases that implement network connections are childs of this one. It's all in the API!!!
 

QT for linux got a nice few libraries for socket programming...
I suggest you read up on the RFC's for ftp...there you will get the basic commands for ftp servers and you can implement this in a call-receive client...to write the server you have to do a listen-accept-reply interface...you can use Beej's guide to socket programing if you have to program this from raw sockets. It is almost the same as programming a web-server and client.
 

First you will need to know under which OS you want to run your FTP client, than get FTP client source (use Google). Modify it by your requirements. Done.

Added after 1 minutes:

If you know MFC you can use this: **broken link removed**
 

hello
if u are familiar with activex then use ftp ocx + win sock ocx

by using ftp.ocx u will have to wite only few lines for ftp server

there are ftp classes present in
www.codeproject.com
u can choise according 2 ur req

u can download ftp acitvex from
www.fathsoft.com
 

I have posted two ebooks in this forum search for them!
 

Here is a good document & code to start with.You can amend the code according to ur requirements...
 

Hi Tom


I am also working on the same project,but on Windows Platform.I need to develop an FTP Client for Windows CE handheld device.If you have any materials on FTP and Windows,pls do send me.Are you done with your project?I need to come up with a working prototype of an FTP client compatible with Windows CE OS.

thanks & regards
John
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top