Socket Programming file sending

Hello everyone,,
I am doing one socket programming.Is it possible to send one file from client to server without using buffer??.I am sending tar files.

Thanks in Advance

Which language do you use? In principle it is of course possible, e.g. using getchar to read from a file and then putchar to write to the socket (in C)

I am using c ,,But i need to send the file without using buffer

Is it possible??

Create a FILE * for the socket and for the file to read from.
Then its simply a

putc(getc(file), socket)

Of course storing this in a variable would make it a little bit clearer, but in principle this should also work

Of course it's possible, it's basically what a netcat link does on the command line. However, you can't bypass the send/receive buffer of the network stack, as that's a driver/kernel system.

If you need information on socket programming, this is a good starting point.

plugdi could you explain the method more...

Which method? I didn't mention any method, only that it's possible. You'll have to be far more specific if you want any meaningful answer here. Also, showing some initiative and researching answers yourself is highly appreciated.

I need to send one tar file from server to client.Is it possible to send the tar file dirctly without using buffer?????
If its not possible could you tell the possible method?

"without using buffer" isn't even possible when using a socket and doesn't make much sense. At the very least the network card may have a buffer of its own, and the receiving end will have buffers that aren't under your control.

What are you actually trying to do? Why this requirement?

Some operating systems support an optimized way to transfer data between file descriptors. It is the sendfile function.
This is the Linux/glibc prototype of the function:

#include <sys/sendfile.h>

       ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count);

but be adivised that (from the Linux senfile(2) man page):

Using this function, you can send data from a file descriptor to a socket descriptor without using [ user space ] buffers.