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.

Threads

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 … Continue reading

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

Threads-using strcpy and analysing the result

RCS file: ./thread.c,v Working file: ./thread.c head: 1.2 branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 2; selected revisions: 2 description: creating multiple threads using pthread_create() joining the created multiple threads using pthread_join() printing the no … Continue reading

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

Thread Creation and Joining the threads created.

RCS file: ./thread.c,v Working file: ./thread.c head: 1.2 branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 2;    selected revisions: 2 description: pthread_create is used to create the thread pthread_exit() is used in the thread created by … Continue reading

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

Threads Vs Processes

Difference Between threads and processes Following are some of the major differences between the thread and the processes : Processes do not share their address space while threads executing under same process share the address space. From the above point … Continue reading

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

Socket

A socket is one end-point of a two-way communication link between two programs running on the network. A server application normally listens to a specific port waiting for connection requests from a client. When a connection request arrives, the client … Continue reading

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

Threads implementation with clients

RCS file: ipc_thrdsrvr.c,v Working file: ipc_thrdsrvr.c head: 1.2 branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 2;    selected revisions: 2 description: —————————- revision 1.2 date: 2014/03/31 11:58:38;  author: root;  state: Exp;  lines: +10 -10 implemented threads … Continue reading

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

A FTP, client-server and networking based Project

PROJECT TITLE : FTP based Client Server project using sockets and threads: Abstract: File Transfer Protocol is a standard network protocol used to transfer files from one host to another host over a TCP based network such as internet. This … Continue reading

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

Code that uses AF_UNIX address family to implement chatting between a single client and server.

RCS file: server.c,v Working file: server.c head: 1.12 branch: locks: strict root: 1.12 access list: symbolic names: keyword substitution: kv total revisions: 12;    selected revisions: 12 description: Code to demonstrate how a server accepts connections from a client on the … Continue reading

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

Code that uses AF_INET address family to implement chatting between client and server through loopback address.

RCS file: server.c,v Working file: server.c head: 1.15 branch: locks: strict root: 1.15 access list: symbolic names: keyword substitution: kv total revisions: 15;    selected revisions: 15 description: Code to demonstrate how a server accepts connections from a client on the … Continue reading

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

Code for a client/server application that uses AF_INET address family for IP sockets.

RCS file: server.c,v Working file: server.c head: 1.6 branch: locks: strict root: 1.6 access list: symbolic names: keyword substitution: kv total revisions: 6;    selected revisions: 6 description: Program to demonstrate how a connection oriented server creates a IP socket to … Continue reading

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

Code for a client/server application that uses AF_UNIX address family for local sockets.

RCS file: simple_c_s_app.c,v Working file: simple_c_s_app.c head: 1.10 branch: locks: strict root: 1.10 access list: symbolic names: keyword substitution: kv total revisions: 10;    selected revisions: 10 description: A simple client/server application in which a server waits for client requests. —————————- … Continue reading

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

Pthread program to understand the working of Thread Semaphore.

RCS file: simple_wait_and_post.c,v Working file: simple_wait_and_post.c head: 1.11 branch: locks: strict root: 1.11 access list: symbolic names: keyword substitution: kv total revisions: 11;    selected revisions: 11 description: Code to demonstrate the working of sem_wait and sem_post. —————————- revision 1.11    locked … Continue reading

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

Pthreads program to find Sum of first n-natural numbers,thread synchronization is achieved by using sleep() system call.

RCS file: sum_of_n_natural_number.c,v Working file: sum_of_n_natural_number.c head: 1.7 branch: locks: strict root: 1.7 access list: symbolic names: keyword substitution: kv total revisions: 7;    selected revisions: 7 description: Code to demonstrate the sum of first n-natural numbers using Pthreads. —————————- revision … Continue reading

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

Creating N-number of threads specified in the command line by the user and each of them will display a message and it’s thread-id

RCS file: N_threads.c,v Working file: N_threads.c head: 1.10 branch: locks: strict root: 1.10 access list: symbolic names: keyword substitution: kv total revisions: 10;    selected revisions: 10 description: Code that will create N number of threads specified in the command line,each … Continue reading

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

Code to demonstrate how to pass string to a thread

RCS file: passing_string.c,v Working file: passing_string.c head: 1.4 branch: locks: strict root: 1.4 access list: symbolic names: keyword substitution: kv total revisions: 4;    selected revisions: 4 description: Code to pass string to a thread. —————————- revision 1.4    locked by: root; … Continue reading

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