EmbLogic's Blog

Category Archives: Project 04: FTP based Client Server using Threads and Sockets

The POSIX thread libraries are a standards based thread API for C/C++. It allows one to spawn a new concurrent process flow. It is most effective on multi-processor or multi-core systems where the process flow can be scheduled to run on another processor thus gaining speed through parallel or distributed processing. Threads require less overhead than “forking” or spawning a new process because the system does not initialize a new system virtual memory space and environment for the process. While most effective on a multiprocessor system, gains are also found on uniprocessor systems which exploit latency in I/O and other system functions which may halt process execution. Parallel programming technologies such as MPI and PVM are used in a distributed computing environment while threads are limited to a single computer system. All threads within a process share the same address space. A thread is spawned by defining a function and its arguments which will be processed in the thread. The purpose of using the POSIX thread library in your software is to execute software faster.
Sockets are the fundamental technology for programming software to communicate on TCP/IP networks. A socket provides a bidirectional communication endpoint for sending and receiving data with another socket. Socket connections normally run between two different computers on a LAN or across the Internet, but they can also be used for interprocess communication on a single computer.

Client-server using socket (AF_UNIX)

RCS file: RCS/client.c,v Working file: client.c head: 1.1 branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 1;    selected revisions: 1 description: client requesting to server via socket —————————- revision 1.1 date: 2014/11/03 13:31:01;  author: root;  state: … Continue reading

Posted in Project 04: FTP based Client Server using Threads and Sockets | Tagged , , | Leave a comment

RCS for FTP based Client Server project using sockets and threads

This  code works for multiple clients trying to download any file at same time using AF_INET. For every  client server creates a new thread and that thread responds to the client. rcs for server. RCS file: ./server.c,v Working file: ./server.c … Continue reading

Posted in Project 04: FTP based Client Server using Threads and Sockets | Leave a comment

Algo for creating threads………

1)In the main,declare a pthread_t type variable. 2)Create a thread using pthread_create. prototype:pthread_create(pthread_t*,attributes,void*(function pointer),void*(argument to be passed)); //attributes=0:::if not used 3)Make a function of return type void *; 4)This function would be called as soon as the thread is created. … Continue reading

Posted in Project 04: FTP based Client Server using Threads and Sockets | Leave a comment

MULTI-THREADED FTP SERVER

Hi guys, I’ve tried to implement a multi-threaded FTP server that enables the clients to download files from the server. I will be posting the project on git-hub along with all its source code. You are most welcome to test … Continue reading

Posted in Project 04: FTP based Client Server using Threads and Sockets | Leave a comment

IPC using sockets ( AF_UNIX , SOCK_STREAM )

Server   ————————————————- RCS file: ./server_socket.c,v Working file: ./server_socket.c head: 1.25 branch: locks: strict root: 1.25 access list: symbolic names: keyword substitution: kv total revisions: 25; selected revisions: 25 description: implemented basic program for server. declared sys/socket.h —————————- revision 1.25 … Continue reading

Posted in Project 04: FTP based Client Server using Threads and Sockets | Leave a comment

Implemented FTP SERVER USING SOCKETS

60    { 61       if(database_size==3) 62          goto label3; 63       i=i+43; 64       goto  label; 65    } 66    read(connect_fd,password,10); 67    j=11; 68 label1: 69    lseek(fd1,j,SEEK_SET); 70    database_size1++; 71    ret=read(fd1,m_password,10); 72    if(ret<0) 73       perror(“reading file\n”); 74    if(!(strcmp(password,m_password))) 75    { 76       flag_password=0; 77    lseek(fd1,j+11,SEEK_SET); 78    … Continue reading

Posted in Project 04: FTP based Client Server using Threads and Sockets | Leave a comment

FTP server using Sockets

RCS file: server.c,v Working file: server.c head: branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 0 description: implemented GETS,PUTS functions in ftp using socket programming. =============================================================================

Posted in Project 04: FTP based Client Server using Threads and Sockets, Uncategorized | Tagged | Leave a comment

TCP/IP Based client & server using socket

Abstract: The POSIX thread libraries are a standards based thread API for C/C++. It allows one to spawn a new concurrent process flow. It is most effective on multi-processor or multi-core systems where the process flow can be scheduled to … Continue reading

Posted in Project 04: FTP based Client Server using Threads and Sockets | Leave a comment

code to pass more than one number of variables into a thread by parent thread

Posted in Project 04: FTP based Client Server using Threads and Sockets | Leave a comment

client server communication using threads and socket

Eurekkkkkkaaaaaaaa…………….. Successfully implemented client server communication using threads and socket. Problems which you might face 1>unsuccessfull bind() 2>unlinking not successfull in AF_INET,,,unlink() won’t work in  this case. 2.1>server_addr.sin_addr.s_addr=IPaddress like 192.168.1.0 not taking showing warning. 3>when to create processing_client and server … Continue reading

Posted in Project 04: FTP based Client Server using Threads and Sockets, Uncategorized | Tagged | Leave a comment

relatin b/w fork() &n execl..

Trying to use execl b/w server and processing clients without fork(); O/P–>block on read or write will definitely occur on server-pro_client side……. When we use fork( ) to create a child process the child process does not contain the entire … Continue reading

Posted in Project 03: Client Server Communication using Linux and IPC, Project 04: FTP based Client Server using Threads and Sockets | Tagged | Leave a comment

Socket using client & server

Most interprocess communication uses the client server model. These terms refer to the two processes which will be communicating with each other. One of the two processes, the client, connects to the other process, the server, typically to make a … Continue reading

Posted in Project 04: FTP based Client Server using Threads and Sockets | Leave a comment

thread using fifo with three client and three processing

server head    1.1; access; symbols; locks root:1.1; strict; comment    @ * @; 1.1 date    2014.06.12.18.58.04;    author root;    state Exp; branches; next    ; desc @three client used into server1. @ 1.1 log @Initial revision @ client1 head    1.1; access; symbols; locks … Continue reading

Posted in Project 04: FTP based Client Server using Threads and Sockets | Leave a comment

server-client using threads in server(using aprox all IPC techniques

RCS file: ./server.c,v Working file: ./server.c head: 1.5 branch: locks: strict root: 1.5 access list: symbolic names: keyword substitution: kv total revisions: 5; selected revisions: 5 description: this is the server accepting data —————————- revision 1.5 locked by: root; date: … Continue reading

Posted in Project 04: FTP based Client Server using Threads and Sockets | Leave a comment

Thread concept

Thread operations include thread creation, termination, synchronization (joins,blocking), scheduling, data management and process interaction. A thread does not maintain a list of created threads, nor does it know the thread that created it. All threads within a process share the … Continue reading

Posted in Project 04: FTP based Client Server using Threads and Sockets | Leave a comment