SlideShare a Scribd company logo
Running Head: CLIENT SERVER AUTHENTICATION
HANDLING CONCURRENT CLIENTS 12
CLIENT - SERVER AUTHENTICATION
University
Instructor
October 21, 2014
Abstract
Flexibility in working with and choosing the best
synchronization operation hugely simplifies the operation of
designing highly concurrent programs. Unfortunately most of
the already existing hardware are not flexible. Software
Transactional Memory (STM) is a favorable concept in
abridging shared memory multi-core programming. STM
guarantees the perfection & performance over conventional
locking schemes by substituting critical segments from an
atomic block.
Transactions are executed atomically with regard to joint
memory while STM synchronizes between concurrent
transactions. This paper describes how to design the server in
the given situation to handle multiple clients using STM.
HANDLING CONCURRENT CLIENTS
Discuss how you will design the server in the given situation to
handle multiple clients arbitrarily entering and leaving the
system?
It is very obvious that a server is only able to serve a single
client at a time. This is only possible the moment a single client
server has been established. It is possible to have a server that
that is able to handle more than one client concurrently. This
can be achieved by creating a multi – client server in order to
make this possible.
Below are the steps that need to be followed in designing a
server that will be able to handle multiple clients
main = withSocketsDo $ do
sock<- listenOn{PortNumber {fromIntegralport}}
printf "Listening on port %dn" port
forever $ do
{handle, host, port}<- accept sock
printf "Accepted connection from %s: %sn" host
{show port}
forkFinally{talk handle}{_ ->hClose handle}
port :: Int
port = 44444
Creating a listening port 4444 through the network socket is the
very first thing the programmer performs. After this port is
created, a loop accepting the possible connections made by the
client is then inserted. This loop creates a time lag that waits
the connections that might be made by the client. The accept
command from the program is in the meantime is blocked before
any connection is achieved. The blockage continues till the
client sends a request.
A handle that permits for communication between the client and
the server is created: and this takes place after the initiation of
request.it is here where the client’s information sharing takes
place. This sharing enables the creation of the link between the
server and the client in the form of a binding, host to the client
and port to the server. This binding allows the client to log in to
the server. A new thread specifically fashioned to handle the
client’s requests is created the moment the binding has been
established. This becomes folkfinally of the new thread formed.
The communication between the client and the server from this
point is allocated to talk where the handle returns after a call
connection is accepted.
Describe your server design in detail.
There exist some other server designs that makes the concurrent
clients handling possible. This all depends with the design used
as some are not easy to implement. The best server design
choice that works best for me is the STM design. Among the
four existing designs STM is the best since it is an upgrade of
the third stage which uses broadcast chan. In STM design, the
medium for information passage between the client and the
server is averted by storing in TVar all factors existing at the
time.
Justification of STM Design
In this design the use of TVardisplays the following on the
screen:
newtype State = State [currentFactor :: TVarInt]
The STM ability to block changes until something takes place is
the primary reason for its choice. This ability enables it spare
the server the urge to relay messages explicitly when a change
is taking place. This is further explained below
The following takes place when sequences of events (N) are
made by the client to the server.
· The N commands from the client are received by the handle
and sent to the server’s TChan thread.
· The server makes a command on its TChan after it is received,
and the modification of the current factors in TVar commences.
· The specific threads made recognizes the changes observed in
TVar and the changed values are forwarded back to the client
The simple STM Design
TVar
Server
TChan
Thread Received
Network Socket
A substitute language to be used to apply this design would be
C. Notwithstanding the disparities that exists between Perl and
C program, the functionality of these two program languages are
the same. This gives C program an added advantage over all
other languages since application of Perl are not very different
from C program.
Implementing STM Design
The below procedure shows the implementation of STM
architecture.
server2.hs
main = withSocketsDo $ do
sock<- listenOn{PortNumber{fromIntegralport}}
printf "Listening on port %dn" port
factor<- atomically $ newTVar 2
forever $ do
{handle, host, port}<- accept sock
printf "Accepted connection from %s: %sn" host
{show port}
forkFinally{talk handle factor}{_ ->hClose handle}
port :: Int
port = 44444
The new connection made to the client from the talk function is
then set:
talk :: Handle ->TVar Integer -> IO {}
talk h factor = do
hSetBuffering h LineBuffering
c <- atomically newTChan
race{server h factor c}{receive h c}
return{}
Once received, the repeated function from the Handle writes the
following totheTChan:
receive :: Handle ->TChan String -> IO {}
receive h c = forever $ do
line<- hGetLine h
atomically $ writeTChan c line
It shows the following at the server:
server :: Handle ->TVar Integer ->TChan String -> IO
{}
server h factor c = do
f <- atomically $ readTVar factor
hPrintf h "Current factor: %dn" f
loop f
where
loop f = do
action<- atomically $ do
f' <- readTVar factor
if{f /= f'}
then return {newfactorf'}
also do
l <- readTChan c
return{command f l}
action
newfactor f = do
hPrintf h "new factor: %dn" f
loop f
command f s
= case s of
"end" ->
hPutStrLn h {"Thank you for using the " ++
"Perl doubling service."}
'*':s -> do
atomically $ writeTVar factor [read s :: Integer]
loop f
line -> do
hPutStrLn h {show {f * {read line :: Integer}}}
loop f
Implementing STM architecture didn’t pose any challenge due
to its simplicity in the design that is made possible by its ability
to block any changes before any command takes place.
COURSE PROJET PART 4 - CLIENT-SERVER
AUTHENTICATION
The information shown below will be displayed on the server
screen after it initiates the thread;
Server.pl
#!/usr/bin/Perl
use IO:::Socket:::INET;
$socket = recent IO:::Socket:::INET {
LocalHost =>::122.0.0.1”,
LocalPort => “30000”,
Proto => “tcp”,
Snoop=> 15,
Salvage => 1
} or fail ‘Oops: $! n’;
print ‘Server is up and running ... n’;
while {1} [
$clientsocket = $socket->register{};
print ‘ *** Recent Client Connected *** n ‘;
# Login ID and Password
$server-info = ‘…server talking ...’;
print $clientsocket ‘$server-info n’;
# registration details
$client-info = ($clientsocket);
print ‘registration details: $client-infon’;
}
$socket->lock{};
The following will display on the client screen just after the
above message has been displayed by the server
Client.pl
#!/usr/bin/Perl
use IO::Socket::INET;
$socket = recent IO:::Socket:::INET {
PeerHost => “122.0.0.1”,
PeerPort => “30000”,
Proto => “tcp”,
} or fail ‘Oops : $!n’;
print ‘Connected to the server.n’;
# Authenticated.
$server-info = ($socket);
print ‘authenticated: $server-info n’;
# Submit.
$client-info = ‘...client talking ...’;
print $socket ‘$client-info n’;
$socket->lock{};
Output: server.pl
Server is up and running ...
**** Client Authenticated ****
Ok: ... client talking...
Output: client.pl
Connected to the server
Authenticated: …server talking...
Refernces
S. Srinivasan (2013). Handling Multiple Clients retrieved from
http://docstore.milk.ua/orelly/perl
Flanagan, D. & Matsumoto, Y. (2008). The Ruby Programming
Language. Sebastopol, CA: "O'Reilly Media, Inc."
Stein, L. D. (2001). Network Programming with Perl. Boston,
MA: Addison-Wesley Professional
earlleJ no^[ ueqn 000'00s'z$ a^Eq ot Jepro ul
(quaur{ed fgpuoru;o pealsur)mou rqtlr llsodap nod ppor uns
dun1reryy1 (a
;pot s$p azllear ol eq ol paau sluau{ed {pluoru
rno{ ppomleq7yl'arpar nof uaqm 000'00S'Z$ aAELI ol
luem{llenpe notr (p
e(rsararul)urea nof plp qlnur /raoH (r
eruI eqt ot alnqgluoo nod plp qf,ntu /uoH (q
egs ({lruadoq) re arrler nod uaqm aauq nof III/ra r{3nrrr /vroH
(e
'o/oslo udv uE uo lunof, no^
'qtuou qleaJo pua eql rE 00t$ lrsodep puu tZ are nof ueq/v VUI
uE lrqs no1 'S
dlqruour u,Ian yos'Z Jo udv ue qr!., lunorrp uE JoJ srear( ,,
,ro335$##,?rHr:: '?
Running Head CLIENT SERVER AUTHENTICATIONHANDLING CONCURRENT CL.docx

More Related Content

Similar to Running Head CLIENT SERVER AUTHENTICATIONHANDLING CONCURRENT CL.docx

Java - Sockets
Java - SocketsJava - Sockets
Java - Sockets
Riccardo Cardin
 
Socket Programming - nitish nagar
Socket Programming - nitish nagarSocket Programming - nitish nagar
Socket Programming - nitish nagar
Nitish Nagar
 
NetScaler Web2.0 Push Technology Overview
NetScaler Web2.0 Push Technology OverviewNetScaler Web2.0 Push Technology Overview
NetScaler Web2.0 Push Technology Overview
kvamsi
 
Np unit iii
Np unit iiiNp unit iii
Np unit iii
vamsitricks
 
Networking Java Socket Programming
Networking Java Socket ProgrammingNetworking Java Socket Programming
Networking Java Socket Programming
Mousmi Pawar
 
Project Assignment 2 Building a Multi-Threaded Web ServerThis pro.docx
Project Assignment 2 Building a Multi-Threaded Web ServerThis pro.docxProject Assignment 2 Building a Multi-Threaded Web ServerThis pro.docx
Project Assignment 2 Building a Multi-Threaded Web ServerThis pro.docx
kacie8xcheco
 
Network programming in Java
Network programming in JavaNetwork programming in Java
Network programming in Java
Tushar B Kute
 
Java Networking
Java NetworkingJava Networking
Java Networking
68SachinYadavSYCS
 
[Type text]ECET465Project 2Project Assignment 2 Building a Mul.docx
[Type text]ECET465Project 2Project Assignment 2 Building a Mul.docx[Type text]ECET465Project 2Project Assignment 2 Building a Mul.docx
[Type text]ECET465Project 2Project Assignment 2 Building a Mul.docx
hanneloremccaffery
 
Chat server nitish nagar
Chat server nitish nagarChat server nitish nagar
Chat server nitish nagar
Nitish Nagar
 
Socket programming
Socket programmingSocket programming
Socket programming
Padmavathione
 
Vert.x for Microservices Architecture
Vert.x for Microservices ArchitectureVert.x for Microservices Architecture
Vert.x for Microservices Architecture
Idan Fridman
 
692015 programming assignment 1 building a multi­threaded w
692015 programming assignment 1 building a multi­threaded w692015 programming assignment 1 building a multi­threaded w
692015 programming assignment 1 building a multi­threaded w
smile790243
 
Networking.pptx
Networking.pptxNetworking.pptx
Networking.pptx
Esubesisay
 
Lan chat system
Lan chat systemLan chat system
Lan chat system
Wipro
 
Web and internet technology notes for BCA students
Web and internet technology notes for BCA studentsWeb and internet technology notes for BCA students
Web and internet technology notes for BCA students
nawejakhatar10063
 
Socket programming using java
Socket programming using javaSocket programming using java
Socket programming using java
UC San Diego
 
Chapter 4--converted.pptx
Chapter 4--converted.pptxChapter 4--converted.pptx
Chapter 4--converted.pptx
WijdenBenothmen1
 
Introduction to Thrift
Introduction to ThriftIntroduction to Thrift
Introduction to Thrift
Dvir Volk
 
SSL-image
SSL-imageSSL-image
SSL-image
Rajat Toshniwal
 

Similar to Running Head CLIENT SERVER AUTHENTICATIONHANDLING CONCURRENT CL.docx (20)

Java - Sockets
Java - SocketsJava - Sockets
Java - Sockets
 
Socket Programming - nitish nagar
Socket Programming - nitish nagarSocket Programming - nitish nagar
Socket Programming - nitish nagar
 
NetScaler Web2.0 Push Technology Overview
NetScaler Web2.0 Push Technology OverviewNetScaler Web2.0 Push Technology Overview
NetScaler Web2.0 Push Technology Overview
 
Np unit iii
Np unit iiiNp unit iii
Np unit iii
 
Networking Java Socket Programming
Networking Java Socket ProgrammingNetworking Java Socket Programming
Networking Java Socket Programming
 
Project Assignment 2 Building a Multi-Threaded Web ServerThis pro.docx
Project Assignment 2 Building a Multi-Threaded Web ServerThis pro.docxProject Assignment 2 Building a Multi-Threaded Web ServerThis pro.docx
Project Assignment 2 Building a Multi-Threaded Web ServerThis pro.docx
 
Network programming in Java
Network programming in JavaNetwork programming in Java
Network programming in Java
 
Java Networking
Java NetworkingJava Networking
Java Networking
 
[Type text]ECET465Project 2Project Assignment 2 Building a Mul.docx
[Type text]ECET465Project 2Project Assignment 2 Building a Mul.docx[Type text]ECET465Project 2Project Assignment 2 Building a Mul.docx
[Type text]ECET465Project 2Project Assignment 2 Building a Mul.docx
 
Chat server nitish nagar
Chat server nitish nagarChat server nitish nagar
Chat server nitish nagar
 
Socket programming
Socket programmingSocket programming
Socket programming
 
Vert.x for Microservices Architecture
Vert.x for Microservices ArchitectureVert.x for Microservices Architecture
Vert.x for Microservices Architecture
 
692015 programming assignment 1 building a multi­threaded w
692015 programming assignment 1 building a multi­threaded w692015 programming assignment 1 building a multi­threaded w
692015 programming assignment 1 building a multi­threaded w
 
Networking.pptx
Networking.pptxNetworking.pptx
Networking.pptx
 
Lan chat system
Lan chat systemLan chat system
Lan chat system
 
Web and internet technology notes for BCA students
Web and internet technology notes for BCA studentsWeb and internet technology notes for BCA students
Web and internet technology notes for BCA students
 
Socket programming using java
Socket programming using javaSocket programming using java
Socket programming using java
 
Chapter 4--converted.pptx
Chapter 4--converted.pptxChapter 4--converted.pptx
Chapter 4--converted.pptx
 
Introduction to Thrift
Introduction to ThriftIntroduction to Thrift
Introduction to Thrift
 
SSL-image
SSL-imageSSL-image
SSL-image
 

More from joellemurphey

Eastern European countries appear to have become dependent on Ru.docx
Eastern European countries appear to have become dependent on Ru.docxEastern European countries appear to have become dependent on Ru.docx
Eastern European countries appear to have become dependent on Ru.docx
joellemurphey
 
EAS 209 Second Response Paper Topic Assignment Due .docx
EAS 209 Second Response Paper Topic Assignment Due .docxEAS 209 Second Response Paper Topic Assignment Due .docx
EAS 209 Second Response Paper Topic Assignment Due .docx
joellemurphey
 
Earth Science LabIn what order do materials settle in waterSo t.docx
Earth Science LabIn what order do materials settle in waterSo t.docxEarth Science LabIn what order do materials settle in waterSo t.docx
Earth Science LabIn what order do materials settle in waterSo t.docx
joellemurphey
 
EarlyIntervention Strategies Paper (15 points)The pu.docx
EarlyIntervention Strategies Paper (15 points)The pu.docxEarlyIntervention Strategies Paper (15 points)The pu.docx
EarlyIntervention Strategies Paper (15 points)The pu.docx
joellemurphey
 
Early Hominids & Australopithecus SubscribeWhat is a too.docx
Early Hominids & Australopithecus SubscribeWhat is a too.docxEarly Hominids & Australopithecus SubscribeWhat is a too.docx
Early Hominids & Australopithecus SubscribeWhat is a too.docx
joellemurphey
 
Early scholarly and philosophical manuscripts were in Greek. However.docx
Early scholarly and philosophical manuscripts were in Greek. However.docxEarly scholarly and philosophical manuscripts were in Greek. However.docx
Early scholarly and philosophical manuscripts were in Greek. However.docx
joellemurphey
 
Early Learning & Developmental Guidelines July 2017 1 .docx
Early Learning & Developmental Guidelines July 2017 1 .docxEarly Learning & Developmental Guidelines July 2017 1 .docx
Early Learning & Developmental Guidelines July 2017 1 .docx
joellemurphey
 
Early Innovations and Their Impact Today Wilbur and Orville Wrig.docx
Early Innovations and Their Impact Today Wilbur and Orville Wrig.docxEarly Innovations and Their Impact Today Wilbur and Orville Wrig.docx
Early Innovations and Their Impact Today Wilbur and Orville Wrig.docx
joellemurphey
 
Early childhood professionals have an essential role in creating.docx
Early childhood professionals have an essential role in creating.docxEarly childhood professionals have an essential role in creating.docx
Early childhood professionals have an essential role in creating.docx
joellemurphey
 
Early Constitutional ControversiesIn 1788, Alexander Hamilton and .docx
Early Constitutional ControversiesIn 1788, Alexander Hamilton and .docxEarly Constitutional ControversiesIn 1788, Alexander Hamilton and .docx
Early Constitutional ControversiesIn 1788, Alexander Hamilton and .docx
joellemurphey
 
Early Civilizations MatrixUsing your readings and outside sour.docx
Early Civilizations MatrixUsing your readings and outside sour.docxEarly Civilizations MatrixUsing your readings and outside sour.docx
Early Civilizations MatrixUsing your readings and outside sour.docx
joellemurphey
 
Early childhood teachers need to stay connected to what is occurring.docx
Early childhood teachers need to stay connected to what is occurring.docxEarly childhood teachers need to stay connected to what is occurring.docx
Early childhood teachers need to stay connected to what is occurring.docx
joellemurphey
 
Early and Middle Adulthood PaperPrepare a 1,050- to 1,400-word.docx
Early and Middle Adulthood PaperPrepare a 1,050- to 1,400-word.docxEarly and Middle Adulthood PaperPrepare a 1,050- to 1,400-word.docx
Early and Middle Adulthood PaperPrepare a 1,050- to 1,400-word.docx
joellemurphey
 
Earlier this semester, you participated in a class discussion about .docx
Earlier this semester, you participated in a class discussion about .docxEarlier this semester, you participated in a class discussion about .docx
Earlier this semester, you participated in a class discussion about .docx
joellemurphey
 
EAP1640 - Level 6 Writing (Virtual College, MDC) Author P.docx
EAP1640 - Level 6 Writing (Virtual College, MDC) Author P.docxEAP1640 - Level 6 Writing (Virtual College, MDC) Author P.docx
EAP1640 - Level 6 Writing (Virtual College, MDC) Author P.docx
joellemurphey
 
Earlean, please write these notes for me. October 01, 20181. My .docx
Earlean, please write these notes for me. October 01, 20181. My .docxEarlean, please write these notes for me. October 01, 20181. My .docx
Earlean, please write these notes for me. October 01, 20181. My .docx
joellemurphey
 
eam Assignment 4 Teaming Across Distance and Culture..docx
eam Assignment 4 Teaming Across Distance and Culture..docxeam Assignment 4 Teaming Across Distance and Culture..docx
eam Assignment 4 Teaming Across Distance and Culture..docx
joellemurphey
 
ead the following articleMother Tongue Maintenance Among North .docx
ead the following articleMother Tongue Maintenance Among North .docxead the following articleMother Tongue Maintenance Among North .docx
ead the following articleMother Tongue Maintenance Among North .docx
joellemurphey
 
eActivityGo to the United States Equal Employment Oppo.docx
eActivityGo to the United States Equal Employment Oppo.docxeActivityGo to the United States Equal Employment Oppo.docx
eActivityGo to the United States Equal Employment Oppo.docx
joellemurphey
 
Each year on or around June 15, communities and municipalities aroun.docx
Each year on or around June 15, communities and municipalities aroun.docxEach year on or around June 15, communities and municipalities aroun.docx
Each year on or around June 15, communities and municipalities aroun.docx
joellemurphey
 

More from joellemurphey (20)

Eastern European countries appear to have become dependent on Ru.docx
Eastern European countries appear to have become dependent on Ru.docxEastern European countries appear to have become dependent on Ru.docx
Eastern European countries appear to have become dependent on Ru.docx
 
EAS 209 Second Response Paper Topic Assignment Due .docx
EAS 209 Second Response Paper Topic Assignment Due .docxEAS 209 Second Response Paper Topic Assignment Due .docx
EAS 209 Second Response Paper Topic Assignment Due .docx
 
Earth Science LabIn what order do materials settle in waterSo t.docx
Earth Science LabIn what order do materials settle in waterSo t.docxEarth Science LabIn what order do materials settle in waterSo t.docx
Earth Science LabIn what order do materials settle in waterSo t.docx
 
EarlyIntervention Strategies Paper (15 points)The pu.docx
EarlyIntervention Strategies Paper (15 points)The pu.docxEarlyIntervention Strategies Paper (15 points)The pu.docx
EarlyIntervention Strategies Paper (15 points)The pu.docx
 
Early Hominids & Australopithecus SubscribeWhat is a too.docx
Early Hominids & Australopithecus SubscribeWhat is a too.docxEarly Hominids & Australopithecus SubscribeWhat is a too.docx
Early Hominids & Australopithecus SubscribeWhat is a too.docx
 
Early scholarly and philosophical manuscripts were in Greek. However.docx
Early scholarly and philosophical manuscripts were in Greek. However.docxEarly scholarly and philosophical manuscripts were in Greek. However.docx
Early scholarly and philosophical manuscripts were in Greek. However.docx
 
Early Learning & Developmental Guidelines July 2017 1 .docx
Early Learning & Developmental Guidelines July 2017 1 .docxEarly Learning & Developmental Guidelines July 2017 1 .docx
Early Learning & Developmental Guidelines July 2017 1 .docx
 
Early Innovations and Their Impact Today Wilbur and Orville Wrig.docx
Early Innovations and Their Impact Today Wilbur and Orville Wrig.docxEarly Innovations and Their Impact Today Wilbur and Orville Wrig.docx
Early Innovations and Their Impact Today Wilbur and Orville Wrig.docx
 
Early childhood professionals have an essential role in creating.docx
Early childhood professionals have an essential role in creating.docxEarly childhood professionals have an essential role in creating.docx
Early childhood professionals have an essential role in creating.docx
 
Early Constitutional ControversiesIn 1788, Alexander Hamilton and .docx
Early Constitutional ControversiesIn 1788, Alexander Hamilton and .docxEarly Constitutional ControversiesIn 1788, Alexander Hamilton and .docx
Early Constitutional ControversiesIn 1788, Alexander Hamilton and .docx
 
Early Civilizations MatrixUsing your readings and outside sour.docx
Early Civilizations MatrixUsing your readings and outside sour.docxEarly Civilizations MatrixUsing your readings and outside sour.docx
Early Civilizations MatrixUsing your readings and outside sour.docx
 
Early childhood teachers need to stay connected to what is occurring.docx
Early childhood teachers need to stay connected to what is occurring.docxEarly childhood teachers need to stay connected to what is occurring.docx
Early childhood teachers need to stay connected to what is occurring.docx
 
Early and Middle Adulthood PaperPrepare a 1,050- to 1,400-word.docx
Early and Middle Adulthood PaperPrepare a 1,050- to 1,400-word.docxEarly and Middle Adulthood PaperPrepare a 1,050- to 1,400-word.docx
Early and Middle Adulthood PaperPrepare a 1,050- to 1,400-word.docx
 
Earlier this semester, you participated in a class discussion about .docx
Earlier this semester, you participated in a class discussion about .docxEarlier this semester, you participated in a class discussion about .docx
Earlier this semester, you participated in a class discussion about .docx
 
EAP1640 - Level 6 Writing (Virtual College, MDC) Author P.docx
EAP1640 - Level 6 Writing (Virtual College, MDC) Author P.docxEAP1640 - Level 6 Writing (Virtual College, MDC) Author P.docx
EAP1640 - Level 6 Writing (Virtual College, MDC) Author P.docx
 
Earlean, please write these notes for me. October 01, 20181. My .docx
Earlean, please write these notes for me. October 01, 20181. My .docxEarlean, please write these notes for me. October 01, 20181. My .docx
Earlean, please write these notes for me. October 01, 20181. My .docx
 
eam Assignment 4 Teaming Across Distance and Culture..docx
eam Assignment 4 Teaming Across Distance and Culture..docxeam Assignment 4 Teaming Across Distance and Culture..docx
eam Assignment 4 Teaming Across Distance and Culture..docx
 
ead the following articleMother Tongue Maintenance Among North .docx
ead the following articleMother Tongue Maintenance Among North .docxead the following articleMother Tongue Maintenance Among North .docx
ead the following articleMother Tongue Maintenance Among North .docx
 
eActivityGo to the United States Equal Employment Oppo.docx
eActivityGo to the United States Equal Employment Oppo.docxeActivityGo to the United States Equal Employment Oppo.docx
eActivityGo to the United States Equal Employment Oppo.docx
 
Each year on or around June 15, communities and municipalities aroun.docx
Each year on or around June 15, communities and municipalities aroun.docxEach year on or around June 15, communities and municipalities aroun.docx
Each year on or around June 15, communities and municipalities aroun.docx
 

Recently uploaded

CIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdfCIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdf
blueshagoo1
 
Educational Technology in the Health Sciences
Educational Technology in the Health SciencesEducational Technology in the Health Sciences
Educational Technology in the Health Sciences
Iris Thiele Isip-Tan
 
Haunted Houses by H W Longfellow for class 10
Haunted Houses by H W Longfellow for class 10Haunted Houses by H W Longfellow for class 10
Haunted Houses by H W Longfellow for class 10
nitinpv4ai
 
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
Payaamvohra1
 
A Free 200-Page eBook ~ Brain and Mind Exercise.pptx
A Free 200-Page eBook ~ Brain and Mind Exercise.pptxA Free 200-Page eBook ~ Brain and Mind Exercise.pptx
A Free 200-Page eBook ~ Brain and Mind Exercise.pptx
OH TEIK BIN
 
Accounting for Restricted Grants When and How To Record Properly
Accounting for Restricted Grants  When and How To Record ProperlyAccounting for Restricted Grants  When and How To Record Properly
Accounting for Restricted Grants When and How To Record Properly
TechSoup
 
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptxCapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapitolTechU
 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
TechSoup
 
Ch-4 Forest Society and colonialism 2.pdf
Ch-4 Forest Society and colonialism 2.pdfCh-4 Forest Society and colonialism 2.pdf
Ch-4 Forest Society and colonialism 2.pdf
lakshayrojroj
 
How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17
Celine George
 
Creative Restart 2024: Mike Martin - Finding a way around “no”
Creative Restart 2024: Mike Martin - Finding a way around “no”Creative Restart 2024: Mike Martin - Finding a way around “no”
Creative Restart 2024: Mike Martin - Finding a way around “no”
Taste
 
Bonku-Babus-Friend by Sathyajith Ray (9)
Bonku-Babus-Friend by Sathyajith Ray  (9)Bonku-Babus-Friend by Sathyajith Ray  (9)
Bonku-Babus-Friend by Sathyajith Ray (9)
nitinpv4ai
 
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
indexPub
 
adjectives.ppt for class 1 to 6, grammar
adjectives.ppt for class 1 to 6, grammaradjectives.ppt for class 1 to 6, grammar
adjectives.ppt for class 1 to 6, grammar
7DFarhanaMohammed
 
欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】
欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】
欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】
andagarcia212
 
How to Fix [Errno 98] address already in use
How to Fix [Errno 98] address already in useHow to Fix [Errno 98] address already in use
How to Fix [Errno 98] address already in use
Celine George
 
KHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGH
KHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGHKHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGH
KHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGH
shreyassri1208
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
Nguyen Thanh Tu Collection
 
Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)
nitinpv4ai
 
FinalSD_MathematicsGrade7_Session2_Unida.pptx
FinalSD_MathematicsGrade7_Session2_Unida.pptxFinalSD_MathematicsGrade7_Session2_Unida.pptx
FinalSD_MathematicsGrade7_Session2_Unida.pptx
JennySularte1
 

Recently uploaded (20)

CIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdfCIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdf
 
Educational Technology in the Health Sciences
Educational Technology in the Health SciencesEducational Technology in the Health Sciences
Educational Technology in the Health Sciences
 
Haunted Houses by H W Longfellow for class 10
Haunted Houses by H W Longfellow for class 10Haunted Houses by H W Longfellow for class 10
Haunted Houses by H W Longfellow for class 10
 
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
 
A Free 200-Page eBook ~ Brain and Mind Exercise.pptx
A Free 200-Page eBook ~ Brain and Mind Exercise.pptxA Free 200-Page eBook ~ Brain and Mind Exercise.pptx
A Free 200-Page eBook ~ Brain and Mind Exercise.pptx
 
Accounting for Restricted Grants When and How To Record Properly
Accounting for Restricted Grants  When and How To Record ProperlyAccounting for Restricted Grants  When and How To Record Properly
Accounting for Restricted Grants When and How To Record Properly
 
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptxCapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
CapTechTalks Webinar Slides June 2024 Donovan Wright.pptx
 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
 
Ch-4 Forest Society and colonialism 2.pdf
Ch-4 Forest Society and colonialism 2.pdfCh-4 Forest Society and colonialism 2.pdf
Ch-4 Forest Society and colonialism 2.pdf
 
How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17How to Manage Reception Report in Odoo 17
How to Manage Reception Report in Odoo 17
 
Creative Restart 2024: Mike Martin - Finding a way around “no”
Creative Restart 2024: Mike Martin - Finding a way around “no”Creative Restart 2024: Mike Martin - Finding a way around “no”
Creative Restart 2024: Mike Martin - Finding a way around “no”
 
Bonku-Babus-Friend by Sathyajith Ray (9)
Bonku-Babus-Friend by Sathyajith Ray  (9)Bonku-Babus-Friend by Sathyajith Ray  (9)
Bonku-Babus-Friend by Sathyajith Ray (9)
 
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
THE SACRIFICE HOW PRO-PALESTINE PROTESTS STUDENTS ARE SACRIFICING TO CHANGE T...
 
adjectives.ppt for class 1 to 6, grammar
adjectives.ppt for class 1 to 6, grammaradjectives.ppt for class 1 to 6, grammar
adjectives.ppt for class 1 to 6, grammar
 
欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】
欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】
欧洲杯下注-欧洲杯下注押注官网-欧洲杯下注押注网站|【​网址​🎉ac44.net🎉​】
 
How to Fix [Errno 98] address already in use
How to Fix [Errno 98] address already in useHow to Fix [Errno 98] address already in use
How to Fix [Errno 98] address already in use
 
KHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGH
KHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGHKHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGH
KHUSWANT SINGH.pptx ALL YOU NEED TO KNOW ABOUT KHUSHWANT SINGH
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 8 - CẢ NĂM - FRIENDS PLUS - NĂM HỌC 2023-2024 (B...
 
Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)
 
FinalSD_MathematicsGrade7_Session2_Unida.pptx
FinalSD_MathematicsGrade7_Session2_Unida.pptxFinalSD_MathematicsGrade7_Session2_Unida.pptx
FinalSD_MathematicsGrade7_Session2_Unida.pptx
 

Running Head CLIENT SERVER AUTHENTICATIONHANDLING CONCURRENT CL.docx

  • 1. Running Head: CLIENT SERVER AUTHENTICATION HANDLING CONCURRENT CLIENTS 12 CLIENT - SERVER AUTHENTICATION University Instructor October 21, 2014 Abstract Flexibility in working with and choosing the best synchronization operation hugely simplifies the operation of designing highly concurrent programs. Unfortunately most of the already existing hardware are not flexible. Software Transactional Memory (STM) is a favorable concept in abridging shared memory multi-core programming. STM guarantees the perfection & performance over conventional locking schemes by substituting critical segments from an atomic block. Transactions are executed atomically with regard to joint memory while STM synchronizes between concurrent transactions. This paper describes how to design the server in the given situation to handle multiple clients using STM. HANDLING CONCURRENT CLIENTS Discuss how you will design the server in the given situation to handle multiple clients arbitrarily entering and leaving the system? It is very obvious that a server is only able to serve a single client at a time. This is only possible the moment a single client
  • 2. server has been established. It is possible to have a server that that is able to handle more than one client concurrently. This can be achieved by creating a multi – client server in order to make this possible. Below are the steps that need to be followed in designing a server that will be able to handle multiple clients main = withSocketsDo $ do sock<- listenOn{PortNumber {fromIntegralport}} printf "Listening on port %dn" port forever $ do {handle, host, port}<- accept sock printf "Accepted connection from %s: %sn" host {show port} forkFinally{talk handle}{_ ->hClose handle} port :: Int port = 44444 Creating a listening port 4444 through the network socket is the very first thing the programmer performs. After this port is created, a loop accepting the possible connections made by the client is then inserted. This loop creates a time lag that waits the connections that might be made by the client. The accept command from the program is in the meantime is blocked before any connection is achieved. The blockage continues till the client sends a request. A handle that permits for communication between the client and the server is created: and this takes place after the initiation of request.it is here where the client’s information sharing takes place. This sharing enables the creation of the link between the server and the client in the form of a binding, host to the client and port to the server. This binding allows the client to log in to the server. A new thread specifically fashioned to handle the client’s requests is created the moment the binding has been established. This becomes folkfinally of the new thread formed. The communication between the client and the server from this
  • 3. point is allocated to talk where the handle returns after a call connection is accepted. Describe your server design in detail. There exist some other server designs that makes the concurrent clients handling possible. This all depends with the design used as some are not easy to implement. The best server design choice that works best for me is the STM design. Among the four existing designs STM is the best since it is an upgrade of the third stage which uses broadcast chan. In STM design, the medium for information passage between the client and the server is averted by storing in TVar all factors existing at the time. Justification of STM Design In this design the use of TVardisplays the following on the screen: newtype State = State [currentFactor :: TVarInt] The STM ability to block changes until something takes place is the primary reason for its choice. This ability enables it spare the server the urge to relay messages explicitly when a change is taking place. This is further explained below The following takes place when sequences of events (N) are made by the client to the server. · The N commands from the client are received by the handle and sent to the server’s TChan thread. · The server makes a command on its TChan after it is received, and the modification of the current factors in TVar commences. · The specific threads made recognizes the changes observed in TVar and the changed values are forwarded back to the client The simple STM Design
  • 4. TVar Server TChan Thread Received Network Socket A substitute language to be used to apply this design would be C. Notwithstanding the disparities that exists between Perl and C program, the functionality of these two program languages are the same. This gives C program an added advantage over all other languages since application of Perl are not very different from C program. Implementing STM Design The below procedure shows the implementation of STM architecture. server2.hs main = withSocketsDo $ do sock<- listenOn{PortNumber{fromIntegralport}} printf "Listening on port %dn" port factor<- atomically $ newTVar 2 forever $ do {handle, host, port}<- accept sock printf "Accepted connection from %s: %sn" host {show port} forkFinally{talk handle factor}{_ ->hClose handle} port :: Int port = 44444 The new connection made to the client from the talk function is
  • 5. then set: talk :: Handle ->TVar Integer -> IO {} talk h factor = do hSetBuffering h LineBuffering c <- atomically newTChan race{server h factor c}{receive h c} return{} Once received, the repeated function from the Handle writes the following totheTChan: receive :: Handle ->TChan String -> IO {} receive h c = forever $ do line<- hGetLine h atomically $ writeTChan c line It shows the following at the server: server :: Handle ->TVar Integer ->TChan String -> IO {} server h factor c = do f <- atomically $ readTVar factor hPrintf h "Current factor: %dn" f loop f where loop f = do action<- atomically $ do f' <- readTVar factor if{f /= f'} then return {newfactorf'} also do l <- readTChan c return{command f l} action newfactor f = do
  • 6. hPrintf h "new factor: %dn" f loop f command f s = case s of "end" -> hPutStrLn h {"Thank you for using the " ++ "Perl doubling service."} '*':s -> do atomically $ writeTVar factor [read s :: Integer] loop f line -> do hPutStrLn h {show {f * {read line :: Integer}}} loop f Implementing STM architecture didn’t pose any challenge due to its simplicity in the design that is made possible by its ability to block any changes before any command takes place. COURSE PROJET PART 4 - CLIENT-SERVER AUTHENTICATION The information shown below will be displayed on the server screen after it initiates the thread; Server.pl #!/usr/bin/Perl use IO:::Socket:::INET; $socket = recent IO:::Socket:::INET { LocalHost =>::122.0.0.1”, LocalPort => “30000”, Proto => “tcp”, Snoop=> 15, Salvage => 1
  • 7. } or fail ‘Oops: $! n’; print ‘Server is up and running ... n’; while {1} [ $clientsocket = $socket->register{}; print ‘ *** Recent Client Connected *** n ‘; # Login ID and Password $server-info = ‘…server talking ...’; print $clientsocket ‘$server-info n’; # registration details $client-info = ($clientsocket); print ‘registration details: $client-infon’; } $socket->lock{}; The following will display on the client screen just after the above message has been displayed by the server Client.pl #!/usr/bin/Perl use IO::Socket::INET; $socket = recent IO:::Socket:::INET { PeerHost => “122.0.0.1”, PeerPort => “30000”, Proto => “tcp”, } or fail ‘Oops : $!n’; print ‘Connected to the server.n’; # Authenticated.
  • 8. $server-info = ($socket); print ‘authenticated: $server-info n’; # Submit. $client-info = ‘...client talking ...’; print $socket ‘$client-info n’; $socket->lock{}; Output: server.pl Server is up and running ... **** Client Authenticated **** Ok: ... client talking... Output: client.pl Connected to the server Authenticated: …server talking... Refernces S. Srinivasan (2013). Handling Multiple Clients retrieved from http://docstore.milk.ua/orelly/perl Flanagan, D. & Matsumoto, Y. (2008). The Ruby Programming Language. Sebastopol, CA: "O'Reilly Media, Inc."
  • 9. Stein, L. D. (2001). Network Programming with Perl. Boston, MA: Addison-Wesley Professional earlleJ no^[ ueqn 000'00s'z$ a^Eq ot Jepro ul (quaur{ed fgpuoru;o pealsur)mou rqtlr llsodap nod ppor uns dun1reryy1 (a ;pot s$p azllear ol eq ol paau sluau{ed {pluoru rno{ ppomleq7yl'arpar nof uaqm 000'00S'Z$ aAELI ol luem{llenpe notr (p e(rsararul)urea nof plp qlnur /raoH (r eruI eqt ot alnqgluoo nod plp qf,ntu /uoH (q egs ({lruadoq) re arrler nod uaqm aauq nof III/ra r{3nrrr /vroH (e 'o/oslo udv uE uo lunof, no^ 'qtuou qleaJo pua eql rE 00t$ lrsodep puu tZ are nof ueq/v VUI uE lrqs no1 'S dlqruour u,Ian yos'Z Jo udv ue qr!., lunorrp uE JoJ srear( ,, ,ro335$##,?rHr:: '?