<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>EmbLogic &#187; Ashish Gupta</title>
	<atom:link href="https://www.emblogic.com/blog/author/ashishgpt715/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.emblogic.com/blog</link>
	<description>Embedded System and ARM Training</description>
	<lastBuildDate>Tue, 03 Mar 2020 13:00:06 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9.1</generator>
	<item>
		<title>socket using AF_INET</title>
		<link>https://www.emblogic.com/blog/04/socket-using-af_inet/</link>
		<comments>https://www.emblogic.com/blog/04/socket-using-af_inet/#comments</comments>
		<pubDate>Sat, 11 Apr 2015 06:54:44 +0000</pubDate>
		<dc:creator><![CDATA[Ashish Gupta]]></dc:creator>
				<category><![CDATA[Project 04: FTP based Client Server using Threads and Sockets]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=12558</guid>
		<description><![CDATA[RCS file: server_inet.c,v Working file: server_inet.c head: 1.8 branch: locks: strict root: 1.8 access list: symbolic names: keyword substitution: kv total revisions: 8; selected revisions: 8 description: this the file for srver &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- revision 1.8 locked by: root; date: 2015/04/11 &#8230; <a href="https://www.emblogic.com/blog/04/socket-using-af_inet/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>RCS file: server_inet.c,v<br />
Working file: server_inet.c<br />
head: 1.8<br />
branch:<br />
locks: strict<br />
	root: 1.8<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 8;	selected revisions: 8<br />
description:<br />
this the file for srver<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.8	locked by: root;<br />
date: 2015/04/11 06:49:58;  author: root;  state: Exp;  lines: +1 -1<br />
here now,performing the reading<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.7<br />
date: 2015/04/11 06:47:43;  author: root;  state: Exp;  lines: +1 -1<br />
here givingf the accept(),so that a particular socket can be created for processing the particular req from the client side<br />
this call will creat the socket that would connect to that particular req<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.6<br />
date: 2015/04/11 06:45:31;  author: root;  state: Exp;  lines: +1 -1<br />
*** empty log message ***<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.5<br />
date: 2015/04/11 06:44:31;  author: root;  state: Exp;  lines: +2 -2<br />
giving the listen(),so that the reaquest from the side of the client can be listed in the list queue<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.4<br />
date: 2015/04/11 06:42:56;  author: root;  state: Exp;  lines: +2 -2<br />
giving the socket call<br />
so that a socket will be created which will return a socket fd<br />
giving the bind call,which will give the name to the socket which we have been created,<br />
so the socket created here will be the named socket<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.3<br />
date: 2015/04/11 06:42:15;  author: root;  state: Exp;  lines: +1 -1<br />
defining the structure variables sin.family,port and addr<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2<br />
date: 2015/04/11 06:40:39;  author: root;  state: Exp;  lines: +1 -1<br />
included the header files<br />
defining the variables<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2015/04/11 06:39:30;  author: root;  state: Exp;<br />
Initial revision<br />
=============================================================================</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/04/socket-using-af_inet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>socket using AF_UNIX</title>
		<link>https://www.emblogic.com/blog/03/socket-using-af_unix/</link>
		<comments>https://www.emblogic.com/blog/03/socket-using-af_unix/#comments</comments>
		<pubDate>Mon, 30 Mar 2015 08:08:40 +0000</pubDate>
		<dc:creator><![CDATA[Ashish Gupta]]></dc:creator>
				<category><![CDATA[Project 04: FTP based Client Server using Threads and Sockets]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=12500</guid>
		<description><![CDATA[head 1.6; access; symbols; locks ashish:1.6; strict; comment @ * @; 1.6 date 2015.03.29.13.01.22; author ashish; state Exp; branches; next 1.5; 1.5 date 2015.03.29.12.57.43; author ashish; state Exp; branches; next 1.4; 1.4 date 2015.03.29.12.56.00; author ashish; state Exp; branches; next &#8230; <a href="https://www.emblogic.com/blog/03/socket-using-af_unix/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>head	1.6;<br />
access;<br />
symbols;<br />
locks<br />
	ashish:1.6; strict;<br />
comment	@ * @;</p>
<p>1.6<br />
date	2015.03.29.13.01.22;	author ashish;	state Exp;<br />
branches;<br />
next	1.5;</p>
<p>1.5<br />
date	2015.03.29.12.57.43;	author ashish;	state Exp;<br />
branches;<br />
next	1.4;</p>
<p>1.4<br />
date	2015.03.29.12.56.00;	author ashish;	state Exp;<br />
branches;<br />
next	1.3;</p>
<p>1.3<br />
date	2015.03.29.12.54.16;	author ashish;	state Exp;<br />
branches;<br />
next	1.2;</p>
<p>1.2<br />
date	2015.03.29.12.44.26;	author ashish;	state Exp;<br />
branches;<br />
next	1.1;</p>
<p>1.1<br />
date	2015.03.29.12.40.43;	author ashish;	state Exp;<br />
branches;<br />
next	;</p>
<p>desc<br />
@showing communication between two file using socket by using AF_UNIX<br />
@</p>
<p>1.6<br />
log<br />
@in the similar way..the more client can be connected</p>
<p>1.5<br />
log<br />
@now giving the connect(),call at the client side so that the req of client that can be for read or write operation,can be listen at the side of server<br />
at the server giving the accept() call,where it creat the copy of socket created above but that would be unnamed,so that created socket will coonected to that particular client for the req came from the client<br />
@<br />
text<br />
@d28 1<br />
@</p>
<p>1.4<br />
log<br />
@now giving a call for listen,by using listen()<br />
so that the req from the client side can be listen by server<br />
with this call a listen queue will be created<br />
where the req from client will be taken<br />
@<br />
text<br />
@d23 1<br />
a23 1</p>
<p>1.3<br />
log<br />
@giving the socket family and its path<br />
socket have been created<br />
now giving the name to the socket by using bind(),call,now the socket in the server have been created as nameed socket<br />
same socket have been created in the client side,but that s unmaed<br />
@<br />
text<br />
@d23 1<br />
a23 1</p>
<p>1.2<br />
log<br />
@includeng the header files<br />
creating the socket by giving the socket(),where we are using the family AF_UNIX<br />
@<br />
text<br />
@d12 1<br />
a12 1</p>
<p>1.1<br />
log<br />
@Initial revision<br />
@<br />
text<br />
@d12 1<br />
a12 1</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/03/socket-using-af_unix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>orphan state</title>
		<link>https://www.emblogic.com/blog/03/orphan-state/</link>
		<comments>https://www.emblogic.com/blog/03/orphan-state/#comments</comments>
		<pubDate>Wed, 25 Mar 2015 07:32:26 +0000</pubDate>
		<dc:creator><![CDATA[Ashish Gupta]]></dc:creator>
				<category><![CDATA[Project 03: Client Server Communication using Linux and IPC]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=12477</guid>
		<description><![CDATA[head 1.1; access; symbols; locks ashish:1.1; strict; comment @ * @; 1.1 date 2015.03.24.13.44.13; author ashish; state Exp; branches; next ; desc @programme for orphan condition where the child terminates after the termination of parents, where the child beacme the &#8230; <a href="https://www.emblogic.com/blog/03/orphan-state/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>head	1.1;<br />
access;<br />
symbols;<br />
locks<br />
	ashish:1.1; strict;<br />
comment	@ * @;</p>
<p>1.1<br />
date	2015.03.24.13.44.13;	author ashish;	state Exp;<br />
branches;<br />
next	;</p>
<p>desc<br />
@programme for orphan condition where the child terminates after the termination of parents,<br />
where the child beacme the orphan<br />
@</p>
<p>1.1<br />
log<br />
@Initial revision<br />
@<br />
text<br />
@#include<br />
#include<br />
#include<br />
#include</p>
<p>int main()</p>
<p>{</p>
<p>char *lines;<br />
int n;<br />
pid_t pid;<br />
printf(&#8220;its starting\n&#8221;);<br />
pid=fork();<br />
printf(&#8220;pid-&gt;%d\n&#8221;,pid);</p>
<p>	switch(pid)<br />
	{</p>
<p>	case -1: printf (&#8220;error\n&#8221;);<br />
	break;</p>
<p>	case 0:	lines=&#8221;mmm child&#8221;;<br />
	printf(&#8220;child id is:%d\t %d\n&#8221;,getpid(),getppid());<br />
	n=7;<br />
	break;<br />
	//its orphan state because here child s going to be terminate after the parent&#8230;.so the child would be orphan here..//</p>
<p>	default: lines=&#8221;mm parent&#8221;;<br />
	printf(&#8220;parent id is :%d\n&#8221;,getppid());<br />
	n=5;<br />
	break;</p>
<p>	}	</p>
<p>		for(;n&gt;0;n&#8211;)<br />
		{<br />
		puts(lines);<br />
		printf(&#8220;%s:my id:%d \t my parent pid is %d\n&#8221;,lines,getpid(),getppid());</p>
<p>		//sleep(1);<br />
		}//child became orphan and it will terminate with pid of init process//<br />
		exit(0);<br />
}</p>
<p>@</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/03/orphan-state/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>USE OF atexit()</title>
		<link>https://www.emblogic.com/blog/03/use-of-atexit/</link>
		<comments>https://www.emblogic.com/blog/03/use-of-atexit/#comments</comments>
		<pubDate>Wed, 25 Mar 2015 07:31:50 +0000</pubDate>
		<dc:creator><![CDATA[Ashish Gupta]]></dc:creator>
				<category><![CDATA[Project 03: Client Server Communication using Linux and IPC]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=12475</guid>
		<description><![CDATA[head 1.3; access; symbols; locks ashish:1.3; strict; comment @ * @; 1.3 date 2015.03.24.12.56.57; author ashish; state Exp; branches; next 1.2; 1.2 date 2015.03.24.12.54.03; author ashish; state Exp; branches; next 1.1; 1.1 date 2015.03.24.12.53.35; author ashish; state Exp; branches; next &#8230; <a href="https://www.emblogic.com/blog/03/use-of-atexit/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>head	1.3;<br />
access;<br />
symbols;<br />
locks<br />
	ashish:1.3; strict;<br />
comment	@ * @;</p>
<p>1.3<br />
date	2015.03.24.12.56.57;	author ashish;	state Exp;<br />
branches;<br />
next	1.2;</p>
<p>1.2<br />
date	2015.03.24.12.54.03;	author ashish;	state Exp;<br />
branches;<br />
next	1.1;</p>
<p>1.1<br />
date	2015.03.24.12.53.35;	author ashish;	state Exp;<br />
branches;<br />
next	;</p>
<p>desc<br />
@programme to use atexit()<br />
@</p>
<p>1.3<br />
log<br />
@now calling the atexit(),from the main(),where the function declared above will be passed as an argu to this function<br />
checking the condition for succeding this func<br />
then if it succed then the ext(),will be called and then final exit would be done</p>
<p>@</p>
<p>1.2<br />
log<br />
@declaring header files<br />
now giving the defination of a function ,which will be called at the time of exit<br />
@<br />
text<br />
@a2 1<br />
///#include<br />
@</p>
<p>1.1<br />
log<br />
@Initial revision<br />
@<br />
text<br />
@d3 1<br />
a3 1<br />
//#include<br />
@</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/03/use-of-atexit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>USING WAIT WHILE DOING MULTIPLE CHILD AND PARENT</title>
		<link>https://www.emblogic.com/blog/03/using-wait-while-doing-multiple-child-and-parent/</link>
		<comments>https://www.emblogic.com/blog/03/using-wait-while-doing-multiple-child-and-parent/#comments</comments>
		<pubDate>Wed, 25 Mar 2015 07:30:41 +0000</pubDate>
		<dc:creator><![CDATA[Ashish Gupta]]></dc:creator>
				<category><![CDATA[Project 03: Client Server Communication using Linux and IPC]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=12473</guid>
		<description><![CDATA[head 1.7; access; symbols; locks ashish:1.7; strict; comment @ * @; 1.7 date 2015.03.24.13.22.13; author ashish; state Exp; branches; next 1.6; 1.6 date 2015.03.24.13.20.46; author ashish; state Exp; branches; next 1.5; 1.5 date 2015.03.24.13.16.32; author ashish; state Exp; branches; next &#8230; <a href="https://www.emblogic.com/blog/03/using-wait-while-doing-multiple-child-and-parent/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>head	1.7;<br />
access;<br />
symbols;<br />
locks<br />
	ashish:1.7; strict;<br />
comment	@ * @;</p>
<p>1.7<br />
date	2015.03.24.13.22.13;	author ashish;	state Exp;<br />
branches;<br />
next	1.6;</p>
<p>1.6<br />
date	2015.03.24.13.20.46;	author ashish;	state Exp;<br />
branches;<br />
next	1.5;</p>
<p>1.5<br />
date	2015.03.24.13.16.32;	author ashish;	state Exp;<br />
branches;<br />
next	1.4;</p>
<p>1.4<br />
date	2015.03.24.13.14.02;	author ashish;	state Exp;<br />
branches;<br />
next	1.3;</p>
<p>1.3<br />
date	2015.03.24.13.12.18;	author ashish;	state Exp;<br />
branches;<br />
next	1.2;</p>
<p>1.2<br />
date	2015.03.24.13.11.36;	author ashish;	state Exp;<br />
branches;<br />
next	1.1;</p>
<p>1.1<br />
date	2015.03.24.13.10.53;	author ashish;	state Exp;<br />
branches;<br />
next	;</p>
<p>desc<br />
@@</p>
<p>1.7<br />
log<br />
@now we will use WEXITSTATUS(),where it willl fetch the code with which the child have been terminated.</p>
<p>@</p>
<p>1.6<br />
log<br />
@now using the fun WIFEXITED(),where it will take the variable in its argu to point where the exit code have been stored</p>
<p>@</p>
<p>1.5<br />
log<br />
@now taking a if(),condition which will run when the value return by  the fork() would be greater than the 0,i.e for parent<br />
where a c1pid variable of prototype pid_t have been declared which will get the return pid of child when it will terminate by giving the wait() to parent so that parent can wait,and child can terminate normally<br />
@<br />
text<br />
@a16 1</p>
<p>@</p>
<p>1.4<br />
log<br />
@providing a for loop<br />
where child and parent would execute in sequence by printing their mesages and pids<br />
where pids will be obtained by using getpid(),getppid()<br />
@<br />
text<br />
@a18 1</p>
<p>a21 1</p>
<p>@</p>
<p>1.3<br />
log<br />
@now doing a fork</p>
<p>where the child and parent would be created<br />
now defining the exit code for each of parent and child<br />
@<br />
text<br />
@a8 1</p>
<p>@</p>
<p>1.2<br />
log<br />
@declaring the header files<br />
declaing the variabels<br />
@<br />
text<br />
@a53 1</p>
<p>@</p>
<p>1.1<br />
log<br />
@Initial revision<br />
@<br />
text<br />
@d54 1<br />
@</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/03/using-wait-while-doing-multiple-child-and-parent/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SELECTION SORTING</title>
		<link>https://www.emblogic.com/blog/03/selection-sorting/</link>
		<comments>https://www.emblogic.com/blog/03/selection-sorting/#comments</comments>
		<pubDate>Wed, 25 Mar 2015 07:28:02 +0000</pubDate>
		<dc:creator><![CDATA[Ashish Gupta]]></dc:creator>
				<category><![CDATA[Data Structures with C]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=12471</guid>
		<description><![CDATA[head 1.5; access; symbols; locks ashish:1.5; strict; comment @ * @; 1.5 date 2015.03.23.13.44.10; author ashish; state Exp; branches; next 1.4; 1.4 date 2015.03.23.13.42.03; author ashish; state Exp; branches; next 1.3; 1.3 date 2015.03.23.13.40.25; author ashish; state Exp; branches; next &#8230; <a href="https://www.emblogic.com/blog/03/selection-sorting/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>head	1.5;<br />
access;<br />
symbols;<br />
locks<br />
	ashish:1.5; strict;<br />
comment	@ * @;</p>
<p>1.5<br />
date	2015.03.23.13.44.10;	author ashish;	state Exp;<br />
branches;<br />
next	1.4;</p>
<p>1.4<br />
date	2015.03.23.13.42.03;	author ashish;	state Exp;<br />
branches;<br />
next	1.3;</p>
<p>1.3<br />
date	2015.03.23.13.40.25;	author ashish;	state Exp;<br />
branches;<br />
next	1.2;</p>
<p>1.2<br />
date	2015.03.23.13.39.13;	author ashish;	state Exp;<br />
branches;<br />
next	1.1;</p>
<p>1.1<br />
date	2015.03.23.13.38.06;	author ashish;	state Exp;<br />
branches;<br />
next	;</p>
<p>desc<br />
@programme for sorting the array by using selection sorting<br />
@</p>
<p>1.5<br />
log<br />
@further process will be done .<br />
displayoing the sorted list.</p>
<p>@</p>
<p>1.4<br />
log<br />
@checking the condition,if the element pointed by the first loop variable is greater thean the element pointed by the second one<br />
if the condition will be true then,only the loop will run<br />
@<br />
text<br />
@a24 1</p>
<p>@</p>
<p>1.3<br />
log<br />
@taking the 2 for loop<br />
first will run from initial position to the end of the length<br />
and second will run from the next pt from the first one up to the last of the length of the array<br />
@<br />
text<br />
@a23 1</p>
<p>@</p>
<p>1.2<br />
log<br />
@taking a array<br />
asking the user to enter the size of array<br />
entering the element of array by the user<br />
@<br />
text<br />
@a22 1</p>
<p>@</p>
<p>1.1<br />
log<br />
@Initial revision<br />
@<br />
text<br />
@d22 1<br />
a22 2</p>
<p>@</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/03/selection-sorting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Insertion sorting</title>
		<link>https://www.emblogic.com/blog/03/insertion-sorting/</link>
		<comments>https://www.emblogic.com/blog/03/insertion-sorting/#comments</comments>
		<pubDate>Wed, 25 Mar 2015 07:25:22 +0000</pubDate>
		<dc:creator><![CDATA[Ashish Gupta]]></dc:creator>
				<category><![CDATA[Data Structures with C]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=12469</guid>
		<description><![CDATA[head 1.8; access; symbols; locks ashish:1.8; strict; comment @ * @; 1.8 date 2015.03.23.13.36.10; author ashish; state Exp; branches; next 1.7; 1.7 date 2015.03.23.13.34.43; author ashish; state Exp; branches; next 1.6; 1.6 date 2015.03.23.13.33.26; author ashish; state Exp; branches; next &#8230; <a href="https://www.emblogic.com/blog/03/insertion-sorting/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>head	1.8;<br />
access;<br />
symbols;<br />
locks<br />
	ashish:1.8; strict;<br />
comment	@ * @;</p>
<p>1.8<br />
date	2015.03.23.13.36.10;	author ashish;	state Exp;<br />
branches;<br />
next	1.7;</p>
<p>1.7<br />
date	2015.03.23.13.34.43;	author ashish;	state Exp;<br />
branches;<br />
next	1.6;</p>
<p>1.6<br />
date	2015.03.23.13.33.26;	author ashish;	state Exp;<br />
branches;<br />
next	1.5;</p>
<p>1.5<br />
date	2015.03.23.13.31.25;	author ashish;	state Exp;<br />
branches;<br />
next	1.4;</p>
<p>1.4<br />
date	2015.03.23.13.29.32;	author ashish;	state Exp;<br />
branches;<br />
next	1.3;</p>
<p>1.3<br />
date	2015.03.23.13.27.59;	author ashish;	state Exp;<br />
branches;<br />
next	1.2;</p>
<p>1.2<br />
date	2015.03.23.13.26.32;	author ashish;	state Exp;<br />
branches;<br />
next	1.1;</p>
<p>1.1<br />
date	2015.03.23.13.25.39;	author ashish;	state Exp;<br />
branches;<br />
next	;</p>
<p>desc<br />
@programme for insertion sorting<br />
@</p>
<p>1.8<br />
log<br />
@displaying the sorted list of arrays<br />
@<br />
text<br />
@</p>
<p>1.7<br />
log<br />
@then out of the loop,the element stored in the temp variable will be copied to the position pointed by the j variable<br />
@<br />
text<br />
@d28 1<br />
a28 1</p>
<p>@</p>
<p>1.6<br />
log<br />
@if the condition will be true then the element pointed by the j is copied to the j+1,<br />
and j will be reduced by 1 to its initial value<br />
@<br />
text<br />
@a26 1</p>
<p>@</p>
<p>1.5<br />
log<br />
@copying the first element in a temporary varible say temp<br />
now taking a while loop,which will chek the condition that if the variable in temp is less than the vaible pointed by the j variable to the next of the array<br />
@<br />
text<br />
@a24 1</p>
<p>@</p>
<p>1.4<br />
log<br />
@taking a for loop which will run up to the size of array nd will start from second to start of the array<br />
@<br />
text<br />
@a23 1</p>
<p>@</p>
<p>1.3<br />
log<br />
@displaying the elements entered by the user<br />
@<br />
text<br />
@a20 1</p>
<p>@</p>
<p>1.2<br />
log<br />
@entering array of number from user<br />
@<br />
text<br />
@a19 1</p>
<p>@</p>
<p>1.1<br />
log<br />
@Initial revision</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/03/insertion-sorting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ipc using threads and messagequeue</title>
		<link>https://www.emblogic.com/blog/03/ipc-using-threads-and-messagequeue/</link>
		<comments>https://www.emblogic.com/blog/03/ipc-using-threads-and-messagequeue/#comments</comments>
		<pubDate>Tue, 24 Mar 2015 15:30:59 +0000</pubDate>
		<dc:creator><![CDATA[Ashish Gupta]]></dc:creator>
				<category><![CDATA[Project 03: Client Server Communication using Linux and IPC]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=12463</guid>
		<description><![CDATA[head 1.9; access; symbols; locks ashish:1.9; strict; comment @ * @; 1.9 date 2015.03.24.12.44.39; author ashish; state Exp; branches; next 1.8; 1.8 date 2015.03.24.12.42.21; author ashish; state Exp; branches; next 1.7; 1.7 date 2015.03.24.12.38.12; author ashish; state Exp; branches; next &#8230; <a href="https://www.emblogic.com/blog/03/ipc-using-threads-and-messagequeue/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>head	1.9;<br />
access;<br />
symbols;<br />
locks<br />
	ashish:1.9; strict;<br />
comment	@ * @;</p>
<p>1.9<br />
date	2015.03.24.12.44.39;	author ashish;	state Exp;<br />
branches;<br />
next	1.8;</p>
<p>1.8<br />
date	2015.03.24.12.42.21;	author ashish;	state Exp;<br />
branches;<br />
next	1.7;</p>
<p>1.7<br />
date	2015.03.24.12.38.12;	author ashish;	state Exp;<br />
branches;<br />
next	1.6;</p>
<p>1.6<br />
date	2015.03.24.12.31.24;	author ashish;	state Exp;<br />
branches;<br />
next	1.5;</p>
<p>1.5<br />
date	2015.03.24.12.20.10;	author ashish;	state Exp;<br />
branches;<br />
next	1.4;</p>
<p>1.4<br />
date	2015.03.24.12.17.36;	author ashish;	state Exp;<br />
branches;<br />
next	1.3;</p>
<p>1.3<br />
date	2015.03.24.12.14.13;	author ashish;	state Exp;<br />
branches;<br />
next	1.2;</p>
<p>1.2<br />
date	2015.03.24.12.06.33;	author ashish;	state Exp;<br />
branches;<br />
next	1.1;</p>
<p>1.1<br />
date	2015.03.24.12.05.45;	author ashish;	state Exp;<br />
branches;<br />
next	;</p>
<p>desc<br />
@this is the programme for communication using threads and messagqueue<br />
@</p>
<p>1.9<br />
log<br />
@now the req client will rcv the result using msgrcv(),and final result will be displayed<br />
in similar manner the more client for different operations would be made<br />
@<br />
text</p>
<p>@<br />
1.8<br />
log<br />
@now the proc will write the result in the server using write(),<br />
now the server will read the result using read(),<br />
and will send th result to the req client using msgsnd() func<br />
@<br />
text<br />
@a59 1</p>
<p>d61 1<br />
a61 1<br />
@</p>
<p>1.7<br />
log<br />
@now doing the execl to access the process which will take out the result<br />
in the process the data wiill be received using msgrcv(),now the further calculation will be depending upon the type of operator<br />
@<br />
text<br />
@d60 1<br />
@</p>
<p>1.6<br />
log<br />
@now creating a pipe which will return two file descripters one for read and one for write<br />
now doing a fork(),which will creat a child and parent.<br />
now we will write the the data using the write fd of pipe to the client which will do the further calculation<br />
@<br />
text<br />
@d53 1<br />
a53 2</p>
<p>@</p>
<p>1.5<br />
log<br />
@declaring a structure to access the operator and operands on which the calculation will be ddone<br />
now reciving the req from first client using msgrcv(),which will access using the id return by msgget,creted for sending and receiving the requests<br />
@<br />
text<br />
@d53 2<br />
a54 1</p>
<p>@</p>
<p>1.4<br />
log<br />
@now,giving the defination of thrd(),<br />
creating the two mesgques,one for sending and reciving the result,and second for the reciving and sending the result<br />
where the both will returns the unique id<br />
@<br />
text<br />
@a18 1</p>
<p>@</p>
<p>1.3<br />
log<br />
@now,declaring the variable,thd,thd_id of prototype pthread_t<br />
now creating a thread using pthread_creat(),where it will give a unique thread id<br />
we have to creat multi,thrd so,,,thrd(),should be provided with a loop<br />
@<br />
text<br />
@a2 1</p>
<p>@</p>
<p>1.2<br />
log<br />
@including the all header file needed<br />
declaring a function for creating a thread<br />
@<br />
text<br />
@d3 1<br />
@</p>
<p>1.1<br />
log<br />
@Initial revision<br />
@<br />
text<br />
@a1 1</p>
<p>@</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/03/ipc-using-threads-and-messagequeue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>client-server using MESSAGEQUEUE</title>
		<link>https://www.emblogic.com/blog/03/client-server-using-messagequeue/</link>
		<comments>https://www.emblogic.com/blog/03/client-server-using-messagequeue/#comments</comments>
		<pubDate>Tue, 17 Mar 2015 11:28:12 +0000</pubDate>
		<dc:creator><![CDATA[Ashish Gupta]]></dc:creator>
				<category><![CDATA[Project 03: Client Server Communication using Linux and IPC]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=12428</guid>
		<description><![CDATA[head 1.7; access; symbols; locks ashish:1.7; strict; comment @ * @; 1.7 date 2015.03.16.21.25.33; author ashish; state Exp; branches; next 1.6; 1.6 date 2015.03.16.21.22.29; author ashish; state Exp; branches; next 1.5; 1.5 date 2015.03.16.21.17.18; author ashish; state Exp; branches; next &#8230; <a href="https://www.emblogic.com/blog/03/client-server-using-messagequeue/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>head	1.7;<br />
access;<br />
symbols;<br />
locks<br />
	ashish:1.7; strict;<br />
comment	@ * @;</p>
<p>1.7<br />
date	2015.03.16.21.25.33;	author ashish;	state Exp;<br />
branches;<br />
next	1.6;</p>
<p>1.6<br />
date	2015.03.16.21.22.29;	author ashish;	state Exp;<br />
branches;<br />
next	1.5;</p>
<p>1.5<br />
date	2015.03.16.21.17.18;	author ashish;	state Exp;<br />
branches;<br />
next	1.4;</p>
<p>1.4<br />
date	2015.03.16.21.09.27;	author ashish;	state Exp;<br />
branches;<br />
next	1.3;</p>
<p>1.3<br />
date	2015.03.16.21.07.19;	author ashish;	state Exp;<br />
branches;<br />
next	1.2;</p>
<p>1.2<br />
date	2015.03.16.21.03.47;	author ashish;	state Exp;<br />
branches;<br />
next	1.1;</p>
<p>1.1<br />
date	2015.03.16.17.18.55;	author ashish;	state Exp;<br />
branches;<br />
next	;</p>
<p>desc<br />
@including the header<br />
creating a message queue for for receing and sending the data.<br />
creating another msgque for receiving and sending the result<br />
@</p>
<p>1.7<br />
log<br />
@now the received result would be written in the req client using msgsnd()<br />
@<br />
text<br />
@#include&#8221;header_mq.h&#8221;//header containing the header files ,a structure which is having the variable for number and operator,union semun used for semaphore,and a sem buffer//</p>
<p>int main()<br />
{<br />
int mq_req,mq_res,mq_send,mq_recv,ret,p1[2],w1,result;<br />
char a[4],b[4];<br />
struct mesg req;<br />
	mq_req=msgget(620,IPC_CREAT|0666);//creating the message queue for requesting which have the a unique keyid,and mode//<br />
	if(mq_req==-1)<br />
	{<br />
		printf(&#8220;error\n&#8221;);<br />
		exit(1);<br />
	}<br />
	printf(&#8220;created for sending req\n&#8221;);<br />
	mq_res=msgget(720,IPC_CREAT|0666);//creating another message queue for taking result,with another unique keyid,and the mod//<br />
	if(mq_res==-1)<br />
	{<br />
		printf(&#8220;error1\n&#8221;);<br />
		exit(1);<br />
	}<br />
	printf(&#8220;created for result\n&#8221;);<br />
	while(1)<br />
	{<br />
	mq_recv=msgrcv(mq_req,&amp;req,sizeof(struct mesg),0,0);//s is the message receive fun() which will receive the message from the mesg queue,where the argu says,id which have been return by the mesg queue creat(),second is the ptr which will point to the message receive,then size of the mesg pntd by the ptr,mesg type,and messg flag//</p>
<p>	if(mq_recv==-1)<br />
	{<br />
		printf(&#8220;error2\n&#8221;);<br />
		exit(1);<br />
	}<br />
	printf(&#8220;created for receiving\n&#8221;);</p>
<p>	printf(&#8220;readed data is %d %c %d\n&#8221;,req.data.num1,req.data.operator,req.data.num2);//here the data from the client have been received by the use of mmessg recv()//<br />
	pipe(p1);//createing the pipe for accessing the procc client//<br />
	printf(&#8220;pipe1 have been created\nrfd-&gt;%d\nwfd-&gt;%d\n&#8221;,p1[0],p1[1]);<br />
	ret=fork();//fork have been done to  creat a child and parent proceess//<br />
	if(ret==0)<br />
	{<br />
		printf(&#8220;child\n&#8221;);<br />
		printf(&#8220;c1\n&#8221;);<br />
		write(p1[1],&amp;req,sizeof(struct mesg));//writing the data in the process client using write(),and doing the execl to enter in proc clint//<br />
		sprintf(a,&#8221;%d&#8221;,p1[0]);<br />
		sprintf(b,&#8221;%d&#8221;,p1[1]);<br />
		printf(&#8220;c2\n&#8221;);<br />
	//	execl(&#8220;/home/ashish/ash/pj3/messagequeue/proc&#8221;,&#8221;./proc&#8221;,a,b,NULL);//use to access the proc where the switch is used to go in diff operation such as,addition,sub,div,ettc,,//<br />
	}<br />
	else<br />
	{	wait(&amp;w1);<br />
		printf(&#8220;parent\n&#8221;);<br />
	//	read(p1[0],&amp;result,sizeof(int));//reading the result from the proc client//<br />
		printf(&#8220;server result-&gt;%d\n&#8221;,result);<br />
		mq_send=msgsnd(mq_res,&amp;result,sizeof(int),0);//here the received result is send to the req client,where the final result is stored//<br />
	}</p>
<p>	}<br />
	}<br />
@</p>
<p>1.6<br />
log<br />
@result have been written to the parent by the proc client<br />
@<br />
text<br />
@d50 1<br />
a50 1<br />
		read(p1[0],&amp;result,sizeof(int));//reading the result from the proc client//<br />
@</p>
<p>1.5<br />
log<br />
@*** empty log message ***<br />
@<br />
text<br />
@d45 1<br />
a45 1<br />
		execl(&#8220;/home/ashish/ash/pj3/messagequeue/proc&#8221;,&#8221;./proc&#8221;,a,b,NULL);//use to access the proc where the switch is used to go in diff operation such as,addition,sub,div,ettc,,//<br />
@</p>
<p>1.4<br />
log<br />
@writing the data received from req client to the proc client<br />
then accessing the proc client by doing the execl.<br />
@<br />
text<br />
@d45 1<br />
a45 1<br />
	//	execl(&#8220;/home/ashish/ash/pj3/messagequeue/proc&#8221;,&#8221;./proc&#8221;,a,b,NULL);//use to access the proc where the switch is used to go in diff operation such as,addition,sub,div,ettc,,//<br />
@</p>
<p>1.3<br />
log<br />
@now a pipe is created which returns the fd for read and write.<br />
doing a fork so that a child andd parent can be created.<br />
reading the data before doing fork,from the req client<br />
@<br />
text<br />
@d45 1<br />
a45 1<br />
		execl(&#8220;/home/ashish/ash/pj3/messagequeue/proc&#8221;,&#8221;./proc&#8221;,a,b,NULL);//use to access the proc where the switch is used to go in diff operation such as,addition,sub,div,ettc,,//<br />
@</p>
<p>1.2<br />
log<br />
@now putting a while loop.<br />
in this loop furthe programming would be done<br />
now creting a messg receving (),which will have the arg as,1.id return by the mesgque created,2.a ptr which will points to the messg to be received,3.this is the size of the message pts by the ptr,and then messg type and flag<br />
@<br />
text<br />
@d32 1<br />
@</p>
<p>1.1<br />
log<br />
@Initial revision<br />
@<br />
text<br />
@d25 1<br />
@</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/03/client-server-using-messagequeue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CO NDITION FOR QUEUE FULL AND EMPTY.</title>
		<link>https://www.emblogic.com/blog/02/co-ndition-for-queue-full-and-empty/</link>
		<comments>https://www.emblogic.com/blog/02/co-ndition-for-queue-full-and-empty/#comments</comments>
		<pubDate>Sun, 08 Feb 2015 03:44:43 +0000</pubDate>
		<dc:creator><![CDATA[Ashish Gupta]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=12109</guid>
		<description><![CDATA[if we check for the condition that queue is full than we will give this  condition if((front==0&#38;&#38;rear==SIZE-1)&#124;&#124;(front==rear+1))//this condition will check the queue and print that queue will be full. and for the empty queue if(front==rear==-1)//this is the condition for checking &#8230; <a href="https://www.emblogic.com/blog/02/co-ndition-for-queue-full-and-empty/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>if we check for the condition that queue is full than we will give this  condition</p>
<p>if((front==0&amp;&amp;rear==SIZE-1)||(front==rear+1))//this condition will check the queue and print that queue will be full.</p>
<p>and for the empty queue</p>
<p>if(front==rear==-1)//this is the condition for checking that queue is empty</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/02/co-ndition-for-queue-full-and-empty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
