ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am currently studying (myself , ) how to use the Sockets API for client server applications. I was designinig a simple ftp server and got stuck up somewhere. So I would just like to see some sample source code and see how it is actually done.
I googled this but I did not get what I wanted.
Could anyone give me a link to the source code of a simple ftp server and client. I do not want a full featured server/client just one in which the client can say ls, get, put and the server responding to those requests.
Also I must emphasize here that I not asking help in some kind of assignment or homework. I am studying myself the Sockets API and got stuck up while writing the code for the ftp server.
If somebody would like to help I would post the exact point where I was getting stuck.
But I feel that would be going into too much programming details and it would be better for me to figure that out myself by looking at some sample source code.
Originally posted by Dave Kelly Doesn't 'apache' meet the requriements?
Sorry, but I didn't quite understand what you were trying to say. I am not looking to configure or set up anything, I am just a student learning how to write a ftp server/client myself in C using the sockets API and I got stuck in between and so was looking for some help.
Hi, sorry that I misunderstood you.I thought you were suggesting me to setup an Apache web server
Now I understand what you were trying to say.
I'll look into the source code of the apache server. Could you give me a link to that ?
Since I am studying client/server programs I think it would be helpfull
Thanks for the help and sorry again for the misunderstanding.
I think the apache code is a bit overkill for what you are trying to do.
I haven't found any good examples in the two seconds I tried to look over the web... but the book "TCP/IP Sockets in C - Practical Guide for Programmers" by Donahoo and Calvert is real good on this subject... and pretty cheap (it is a tiny book). It shows a lot of examples in C of clients and servers, and it contains a complete sockets API reference.
Read the example of an echo client/server from :
Addison.Wesley.UNIX.Network.Programming.Volume.1.3rd.Ed.The.Sockets.Networking.API. and it helped me solve the problem.
I also bought the book "TCP/IP Sockets in C - Practical Guide for Programmers" and it seems to be a great reference.
ftp simple client and server code just to do ls,send and get
Quote:
Originally Posted by koodoo
Hi, thanks for the help.
Finally figured out what mistake I was making.
Read the example of an echo client/server from :
Addison.Wesley.UNIX.Network.Programming.Volume.1.3rd.Ed.The.Sockets.Networking.API. and it helped me solve the problem.
I also bought the book "TCP/IP Sockets in C - Practical Guide for Programmers" and it seems to be a great reference.
Thanks again for the help.
can you help me sending a sample ftp simple client and server code just to do ls,send and get
I didn't found any thing in google and I am new in c .
can you help me sending a sample ftp simple client and server code just to do ls,send and get
I didn't found any thing in google and I am new in c .
regards
In the name of the Flying Spaghetti Monster,
Your first step is to become old in C.
I don't know whether there are "simple" ftp clients and servers out there, but if you want to peruse fullblown versions, you can get the source code for a client here and a server here.
Hi,
I m currently doing program for ftp were client request a file and server respond by sendibg content of a file.
I have did the simple client/server file transfering but I m facing problem with ftp
please help me or give a link for sample code for file tranfer using ftp.
Last edited by Raghu97931; 02-28-2011 at 07:03 AM.
Reason: adding more specification
If I'm not mistaken, the FTP server is usually implemented as a client of the inetd/xinetd daemon. As such, it should not do any socket-level IO, only reading and writing to standard input & standard output. FTP clients seem to be abundant in source code form, but most seem to target Microsoft platforms, so the socket interface is probably different. I don't know for sure, but my hunch is that the relevant RFC(s) probably spell out the minimum requirement for a conforming FTP client or server, and this may make it difficult to locate a dumbed-down version for study.
--- rod.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.