I nte rna t io na l J o urna l o f   I nfo rm a t ics a nd   Co m m un ica t io n T ec hn o lo g y   ( I J - I CT )   Vo l. 8 ,   No . 3 ,  Dec em b er   2 0 1 9 ,   p p .   1 3 9 ~ 1 5 1   I SS N:  2252 - 8 7 7 6 ,   DOI : 1 0 . 1 1 5 9 1 /iji ct. v 8 i3 . p p 1 3 9 - 1 51          139       J o ur na l  ho m ep a g e :  h ttp : //ia e s co r e. co m/jo u r n a ls /in d ex . p h p / I JI C T   Financia l stock a pplica tion usin g   webso cket  in    real  t ime a pp lica t io n       Yink a - B a njo   Chik a ,   O g un dey i K ehind e  E s t her   De p a rt m e n t  o f  Co m p u ter sc ien c e ,   Un iv e rsit y   o f   Lag o s,  Nig e ria       Art icle  I nfo     AB S T RAC T   A r ticle  his to r y:   R ec eiv ed   Oct   1 0 ,  2 0 1 9   R ev is ed   No v   13 ,   2 0 1 9   Acc ep ted   No v   2 3 ,   2 0 1 9       Re a l  ti m e   we b   a p p li c a ti o n   i n v o l v e s  c li e n ts  wh ic h   is   a lso   k n o wn   a s  a   b r o ws e r  g e tt in g   u p d a tes   fr o m   t h e   se rv e r   a s  th e y   h a p p e n .   Th e   fin a n c e   wo rl d   is  m o v i n g   fa st,  a n d   h u m a n   b ra i n s  c a n n o t   su sta in   p ro c e ss in g   d a ta  a t   th a t   sp e e d ,   so   a lg o rit h m s  a re   u se d   with   re g a r d s  to   t h e   li m it   o b se rv e d   i n   o l d - sty l e   re a l - ti m e   c o m m u n ica ti o n   wh ich   i n c lu d e   l o n g   p o ll i n g ,   p o ll in g   se rv e r - se n t  e v e n ts  a n d   c o m e ts,  th is  p a p e r  u se s  Web S o c k e t  tec h n o l o g y   wh e n   d e a li n g   wit h   re a l  ti m e   a p p li c a ti o n s.  Th e   Web   S o c k e t  o ffe rs  imp ro v e d   re su lt   a s  c o m p a r e d   to   th e   c o n v e n ti o n a l  a p p r o a c h e s  th a t   a re   c o n sid e re d   to   b e   g o o d   so l u ti o n   o f   p r o v i d i n g   re a l  ti m e   in fo rm a ti o n   a n d   les se n s  o v e rh e a d   a c q u ire d   wh i le  c o m m u n ica ti n g   o v e r  t h e   i n tern e t   a n d   o ffe rs  sta t e fu l,   e fficie n t   c o m m u n ica ti o n   a m o n g   we b   se rv e rs  a n d   c li e n ts .   W h e n   t h e re   is  n e e d   to   trac k   c o m p a n ies   wo rt h /st o c k   u si n g   a   d a sh b o a r d   imm e d iate ly   a n d   n o t   so m e   se c o n d s  a g o ,   Web S o c k e t  c a n   b e   u se d   to   stre a m   d a ta wit h o u t   d e lay s .   K ey w o r d s :   C o m et   HT T P  p o llin g   R ea l  t im e   Ser v er s en t e v en t   W eb s o ck et   Co p y rig h t  ©  2 0 1 9   In stit u te o f  A d v a n c e d   E n g i n e e rin g   a n d   S c ien c e .     Al l  rig h ts re se rv e d .   C o r r e s p o nd ing   A uth o r :   Yin k a - B an jo   C h ik a ,   Dep ar tm en t o f   C o m p u ter   Scie n ce   Un iv er s ity   o f   L a g o s ,   Ak o k a  R d ,   Yab a,   L ag o s ,   Nig e r ia .   E m ail:  ch ik ab an jo @ u n ilag . e d u . n g       1.   I NT RO D UCT I O N   R ea l  tim e  web   ap p licatio n   in v o lv es  clien ts   wh ich   is   a ls o   k n o wn   as  a  b r o wser   g ettin g   u p d at es  f r o m   th e  s er v er   im m e d iately   as  th e y   o cc u r   [ 1 ] .   An   ex am p le   o f   r ea l   tim e  web   ap p licatio n   is   g o o g le  d o c   in   wh ich   d o cu m e n ts   ca n   b e  ed ited   b y   a   u s er   an d   at  th e   s am e  tim e  s ee   wh at  is   b ee n   d o n e  b y   o th er s   s im u ltan eo u s ly .   Hy p er tex t  T r an s f er   Pr o to co l  ( HT T P),   an   ap p licatio n   lay er   p r o to co l  ( s tateless   an d   r eq u es t - r esp o n s e   b ased )   is   th e  b asi s   f o r   th e  co m m u n icatio n   b etwe en   s er v er s   an d   b r o wser s .   A  r eq u est  is   in itiated   b y   an   HT T P   clien t,  th er eb y   estab lis h in g   a  T r an s m is s io n   C o n tr o l  Pro to co l  ( T C P)  co n n ec tio n   [ 2 ] .   Af ter   th e  clien t’ s   r eq u est  h as b ee n   r ec eiv e d ,   a   r esp o n s e   is   s en t b ac k   b y   th e   s er v er   an d   t h er ea f ter   th e  c o n n ec tio n   is   te r m in ated .   Usi n g   th is   m o d el,   r ea l  tim e   d ata  ca n n o t  b e  s en t  b y   s er v e r s   to   clien ts .   C o n s eq u en tly ,   T ec h n o lo g ies  lik e  Ajax   lo n g   p o llin g   an d   co m et  h av e   b ee n   u s ed   t o   ac co m p lis h   r ea l  tim e  c o m m u n icatio n   b etwe en   s er v e r   an d   cli en t.  Sti ll,  r ea l  tim e  co m m u n icatio n   ca n n o t  b e  ac c o m p lis h ed   with   th ese  tech n o l o g ies  b ec au s e  s o m e  o f   th em   n ee d s   p lu g - in   to   b e  in s talled   o n   b r o wser   wh ich   p u t  h ea v y   b u r d en   o n   th e  s er v e r .   R ea l  tim e  d ata  co m m u n icatio n   was  ac h iev ed   wit h   th e   ad v en t  o f   W eb   s o ck et  p r o t o co l a n d   HT ML   5 .   W eb So ck et  d escr ip tio n   d ep ict s   an   Ap p licatio n   Pro g r am m in g   I n ter f ac e  w h ich   allo w  th e  u s e  o f   web   s o ck et  p r o t o co l  b y   a   web   p a g e  f o r   two - way   co m m u n ic ati o n   alo n g s id e  a   r em o te   h o s t  [ 3 ] .   T h u s ,   th e   HT T P  s o lu tio n   ca n   s im u la te  th e  r ea l  tim e  co m m u n icatio n   with   h ig h   tag   in   p r ice,   in cr ea s ed   n etwo r k   tr af f ic  a n d   in cr ea s ed   laten cy .   T h e  r esu lts   to   ac t   o u t  th e   f u ll   d u p lex   co n n ec tio n   wer e   u n s ca lab le  p o llin g   a n d   lo n g   p o llin g   m eth o d s .   W eb So ck et  o f f er s   th e  in cr ed ib le  r ed u ctio n   in   th e  q u a n tity   o f   laten c y   an d   n etwo r k   tr af f ic  in   co m m u n icatio n   s y s tem .   T h e  W eb So ck et  is   q u ick er   th an   th e s e  o ld - f ash io n ed   s o lu tio n s .   I t is an   estab lis h ed   f ac t t h at  d a ta  ar e  r ec eiv ed   b y   th e   s er v er   wh en   r e q u e s ts   ar e   m ad e   f r o m   cli en t’ s   s id e   w h en   s u ch   d ata  ar e  r ec eiv ed   b y   th e  s er v e r ,   it  b ec o m es  its   r esp o n s ib ilit y   to   ac c o m p lis h   th e   task .   T h is   h as  b ee n   Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   2 2 5 2 - 8 7 7 6   I n t J I n f   &   C o m m u n   T ec h n o l ,  Vo l.  8 ,   No .   3,   Dec  2 0 1 9   :  1 3 9   –   151   140   th e  s tan d ar d   u s ed   f o r   a  lo n g   tim e  u n til  th e  ad v e n t  o f   AJAX  in   2 0 0 5   wh ich   lead   to   th e  d is co v er y   o f   b id ir ec tio n al   co n n ec tio n s   b etwe en   s er v er   a n d   clien t.  T h er e  h as  b ee n   a   lo t  o f   in c r ea s e  in   th e  c o n s u m p tio n   o f   d ata  in   we b   ap p licatio n ,   b u t  th e  m ajo r   d r a wb ac k   to   th e  im p r o v em e n t  o f   t h is   is   th e  tr ad itio n al  HT T P  m o d el  o f   clien t - in itiated   tr an s ac tio n s   b ee n   u s ed .   T o   o v er co m e  th is ,   th e r e  ar e   d if f e r en t stra teg ies u s ed   to   p u s h   d ata   to   th e  clien t   f r o m   th e   s er v er   an d   o n e  o f   th e   p o p u lar   s tr ateg ies  u s ed   is   lo n g   p o llin g   wh ich   k ee p s   HT T P  co n n ec tio n   o p e n   u n til  d ata  h as  b ee n   p u s h   f r o m   th e  s er v er   to   t h e  clien t   o wn   to   th e  clien t.   T h e  f law  in   th e  s tr ateg ies  in tr o d u ce d   is   th at  th ey   tr an s m it  o v er h ea d   o f   HT T P  an d   lar g e  c o o k ie  d ata  an d   h ea d er s   ar e  u s u ally   tr a n s f er r ed   alo n g s id e  an   HT T P  r eq u est  wh ich   in cr ea s es  th e  s ize  o f   th e  d ata  wh ich   is   to   b e  s en t th er eb y   in cr ea s in g   late n cy .   T o   d ev elo p   a  f in a n cial  s to ck   ap p licatio n   ap p licatio n   th at  cr ea te  a  p er s is ten t,  lo w  laten cy   co n n ec tio n   th at  ca n   s u p p o r t  tr a n s ac tio n s   in itiated   b y   eith er   th e  clien t  o r   s er v er ,   W eb So ck et  h as  b ee n   u s ed   to   d em o n s tr ate   an   ef f ec tu al  R ea ltime   web .   W eb So ck et  p r o v id e  a  p er s is ten t  co n n ec tio n   b etwe en   a  clien t  a n d   s er v er   th at  b o th   p ar ties   ca n   u s e  t o   s tar t  s en d in g   d ata  at  an y   tim e.   T h e  clien t   estab lis h es   a  W eb So ck et  co n n ec tio n   th r o u g h   a   p r o ce s s   k n o w n   as  th e  W eb So c k et  h an d s h ak e.   T h is   p r o ce s s   s tar ts   with   th e  clien t  s en d in g   a  r e g u lar   HT T P  r e q u est  to   th e  s er v er .   T h e  W eb   s tar ted   o u t  as  a   s im p le  d o cu m en t  s h ar in g   s er v ice  to   m ak e  th e  liv es  o f   r esear ch er s   s im p ler .   T h e  tr an s itio n   in to   t h e  W eb   o f   to d ay   h as  b ee n   m a d e  p o s s ib le  b y   th e  f ac t  th at  it  b ec am e  c ap ab le  o f   r ea l - tim e  u p d ates.  T h e  r ea l - tim e  web   en ab les a  web s ite  to   u p d ate  its elf   d y n am ically   w h en   n ew  c o n te n t  is   av ailab le.   T h e  f o llo win g   two   ex am p les illu s tr ate  th e  m ea n in g   o f   th e   ter m   r ea l - tim e:   -   A  s to ck   p r ice  a p p licatio n   wh e r e  s ev er al  clien ts   co n n ec t  to   a   s er v er .   A  s to ck   a p p licatio n   is   a  s y m b o l  wh ic h   is   u s ed   to   u n iq u ely   id en tify   co m p an y   s to ck .   T h is   s to ck   p r ice  s er v er   s u b s cr ib es  to   a  b r o k er   b ac k en d   f o r   s to ck   p r ice  u p d ates.  W h en   th e  s to ck   p r ice  s er v er   r ec eiv es  p r ice  u p d ates  f r o m   th e  b ac k e n d ,   it  b r o ad ca s ts   th ese  to   all  clien ts .   -   A  ch at  r o o m   ap p licatio n   wh er e  s ev er al  clien ts   co n n ec t  to   a  ce n tr alize d   s er v er .   T h e  s er v er   lis ten s   f o r   clien t  m ess ag es  an d   as  s o o n   as  a  clien t  s en d s   a  m ess ag e  to   th e  s er v er ,   th e  s er v er   im m e d iately   b r o ad ca s ts   th e   m ess ag e  to   all  o th er   co n n ec ted   clien ts .   B o th   ex am p les  s h o w  th at  d ata  is   h an d led   an d   d is tr ib u t ed   im m ed iately   af ter   it  is   r ec eiv ed ,   wh ich   is   w h at  is   m ea n t  b y   th e  ter m   r ea l - ti m e  in   th is   r esear ch .   T h e  f ir s t  ex am p le  r e q u ir es   u n id ir ec tio n al  m ess ag in g ,   w ith   s to ck   p r ices  o n ly   g o in g   s er v er - to - clien t.  T h e   s ec o n d   ex am p le  is   b id ir ec tio n al,   r e q u ir in g   b o t h   s er v er - to - clien t a n d   clien t - to - s e r v er   m ess ag in g .     E v en   th o u g h   r ea l - tim e  ca p a b ilit ies  wer e  n o t  c o n s id er ed   wh en   th e  W eb   was  d esig n e d ,   th e r e  a r e  s ev er al   way s   to   u s e  tr ad itio n al  HT T P  in   o r d e r   to   ac h iev e  n ea r   r ea l - ti m e  u p d ates,  s u ch   as  th e  tech n i q u es  L o n g   Po llin g   an d   Stre am in g .   R ec en tly ,   with   th e  n ew  p r o to c o l  W eb So ck et  an d   th e  n ew  HT T P - b ased   tech n o lo g y   Ser v er - Sen t   E v en ts ,   a  tr u e  r ea l - tim e  web   is   p o s s ib le.   T h is   r esear ch   will  th er ef o r e   f o c u s   o n   W eb So ck et,   Ser v er - Sen t  E v en ts ,   an d   HT T P L o n g   Po llin g .   Ser v er - Sen t E v en ts   an d   L o n g   Po llin g   ar e  b o th   u n id ir ec tio n al  ( s er v er - to - clien t)   wh ile   W eb So ck et  is   b id ir ec tio n al  ( s e r v er - to - clien t  an d   clien t - to - s er v er ) .   Fo r   s im p licity ’ s   s ak e,   th is   p ap er   will  r ef er   to   th e  r ea l - tim e  d eliv er i n g   tech n o lo g ies as tr an s p o r ts .   I t is b eli ev ed   th at  W eb So ck et  p e r f o r m s   b etter   th an   HT T P.   T h e  p r o b lem   with   all  o f   o ld - s ty le  r ea l - tim e  co m m u n icatio n   is   th at  th ey   ca r r y   th e  o v er h ea d   o f   HT T P.   E v er y   tim e  y o u   m a k e  an   HT T P  r eq u est  a  b u n c h   o f   h ea d e r s ;  co o k ie  d at a  a r e  tr an s f er r e d   to   t h e  s er v er .   T h is   ca n   ad d   u p   to   a  r ea s o n a b ly   lar g e  a m o u n t o f   d ata  th at  n ee d s   to   b e   tr an s f er r ed ,   wh ich   in   tu r n   in cr ea s es   laten cy   wh en   d ev elo p in g   a   r ea l  tim e  a p p lica tio n ,   r e d u cin g   laten cy   is   cr u ci al  to   k ee p in g   th in g s   r u n n i n g   s m o o th ly .   T h e   wo r s t  p ar t o f   t h is   is   th at  a  lo t o f   th es e  h ea d er s   an d   co o k ies ar e  n o t  ac tu ally   n ee d ed   to   f u l f il th e  clien t’ s   r eq u est.   Fo r   d ev el o p in g   a   f in an cial   s to ck   ap p licatio n   th at   cr ea te  a   p e r s is ten t,   lo w  laten cy   c o n n ec ti o n   th at  ca n   s u p p o r t  tr a n s ac tio n s   in itiated   b y   eith er   th e  clien t  o r   s er v e r ,   W eb So ck et  will  b e  ap p lied   to   illu s tr ate  ef f icien t  r ea ltime   web .   W eb So ck et  p r o v id e  a  p er s is ten t  co n n ec tio n   b etwe en   a  clien t  an d   s er v er   th at  b o th   p ar ties   ca n   u s e  to   s tar t  s en d in g   d ata  at  an y   tim e.   T h e   clien t  estab lis h es  a  W eb So ck et  co n n ec tio n   th r o u g h   a  p r o ce s s   k n o wn   as   th e  W eb So ck et  h an d s h a k e.   T h is   p r o ce s s   s tar ts   with   th e  clien t   s en d in g   a  r eg u lar   HT T P r eq u est to   th e  s er v er .   W eb So ck et  Pro to co l,  s im ilar   to   So ck et  wh o s e  co m m u n icatio n   is   b ased   o n   T C P/IP  is   a  f u ll  d u p le x   co m m u n icatio n   p r o to co l  [ 4 ] .   T h e  m ajo r   a d v an ta g e  o f   W eb So ck et  is   th at  in f o r m atio n   ca n   b e  s en t  b etwe en   clien t   an d   s er v er   at  an y   tim e.   Ajax   co m m u n icatio n   d o es  n o t  r estra in   W eb So ck et  b ec au s e  in   Ajax   tech n o lo g y ,   it  is   r eq u ir ed   th at  th e  clien t  i n itiate  th e  r eq u est.  C o n tem p o r a r y   b r o wser   f u lly   s u p p o r ts   W eb So ck et  p r o to co l  s o   W eb So ck et  clien t c an   p u s h   d a ta  to   th e  s er v er   [ 5 ].   T h e  estab lis h m en t  o f   W eb So c k et  co n n ec tio n   is   in   th is   m a n n er ,   th e  b r o wser   f ir s t  s en d s   a  W eb S o ck et  co n n ec tio n   r eq u est,  in   wh ich   t h e  b r o wser   r esp o n d s   to   th e   r eq u est  s en t  b y   th e  clien t ,   th e   p r o c ess   d escr ib ed   ab o v e   is   k n o wn   as  ‘ h an d s h ak e ’ .   T h e   d ata  tr an s m is s io n   at  th is   p h as e  is   b ased   o n   tex t  an d   u s e  ASC I I   en co d in g   a n d   is   co m p atib le  with   ex is tin g   HT T P /1 . 1   p r o t o co ls   [ 2 ]   W eb So ck et  is   co n n ec tio n   o r ie n ted   wh ich   im p lies   th at  if   a  b r o ad ca s t  m ess ag e  is   s en t  f r o m   t h e  s er v er ,   th ey   ar e   in s tan tly   d is p er s ed   to   all  clien t.  T h is   f ea tu r e  m a k es  web s o ck et  co n tain i n g   o n ly   o n e  co m p o n en t   f o r   b o th   clien t n d   s er v er   c o m m u n ic atio n .   [6 ]     Evaluation Warning : The document was created with Spire.PDF for Python.
I n t J I n f   &   C o m m u n   T ec h n o l   I SS N:  2252 - 8 7 7 6       F in a n cia l sto ck   a p p lica tio n   u s in g   w eb s o ck et   in   r ea l time   a p p lica tio n   ( Yin ka - B a n jo   C h ika )   141   T h e  aim   o f   th is   p ap er   is   to   cr ea te  a  f in an cial  s to ck   ap p licatio n   u s in g   W eb So ck et.   T h e  d etailed   o b jectiv es a r e:   -   C r ea tin g   a  web - b ased   s y s tem   f in an cial  s to ck   ap p licatio n   -   I n teg r atio n   o f   W eb So ck et  f r a m ewo r k   s y s tem   in   f in an cial  s to ck   ap p licatio n   s y s t em     T h is   p r o ject  h as  f o cu s ed   o n   r e al - tim e  co m p u tin g   f r o m   a  s o f twar e  an d   web   ap p licatio n   p er s p ec tiv e  in   im p lem en tin g   web   s o ck et  p r o t o co l w ith   a  f in a n cial  ap p licati o n   s y s tem   f o r   p r esen tin g   r ea l t im e  m ar k et  d ata.     T h is   p r o ject   is   lim ited   d u e   to   t h e  f ac t   th at  W eb   So ck et   is   n o t   f u lly   s u p p o r ted   b y   cu r r en t   b r o wser ,   an d   d if f e r en t   b r o wser   s u p p o r t  d if f er en t  p o r ti o n   o f   th e  W eb   So ck et  s p ec if ic atio n .   Fo r   th is   d r i v e  to   m a k e  r e al  tim e  ap p licatio n s   ca p ab le  o f   r u n n in g   an y w h er e,   th e  clien t  s id e  s h o u ld   co m p r is e  s o m e  W eb   So ck e t  s im u latio n   f r am ewo r k   s u ch   as  Sig n alR ,   wh ich   p r o v i d es C #   lib r ar y     T h e  m eth o d o l o g ies  u s ed   f o r   im p lem en tin g   th e  f in a n cial  s to ck   ap p licatio n   p r o ject  is   W eb So ck et.   T h e  web   s o ck et  s er v er   will  also   b e   im p lem en ted   u s in g   C #   L ib r a r y .   T h e   co d e   will  b e   wr itten   u s in g   s tan d ar d   lib r a r ies  av ailab le  in   b o th   W in d o ws  an d   L in u x   f o r   m ax im u m   p o r tab i lity .   T h ir d   p ar t y   lib r a r ies  m u s t   o n ly   b e   u s ed   i f   th e   licen s in g   is   p er m is s iv e.   So f tw ar e  d ev elo p m en t  will  b e  co n d u cted   in   an   iter ativ e  way .   W o r k   will  f o llo w  a  b asic   p lan   an d   allo w  f o r   ch an g es  d u r in g   th e  im p lem e n tatio n   if   a d d itio n al  f ea tu r es  ar e  r e q u ir e d   o r   if   p er f o r m a n ce   is s u es with   th e  s elec ted   d esig n   s u r f ac e.     2.   RE S E ARCH   M E T H O D    Sy n ch r o n o u s   co m m u n icatio n   s y s tem   also   k n o w n   as  r ea l - tim e   co m m u n icatio n   s y s tem   alwa y s   in clu d es  a  lar g e   n u m b er   o f   p ass iv e  r ec i p ien ts   [ 7 ].   W eb   clien ts   is   ab le  to   p o ll   s er v er - s id e  e v en ts   b ec a u s e  o f   th e   L ig h t   co m f o r t  p r o v id ed   b y   A J AX  to   th e  HT T P  co m m u n icatio n   m o d e l.  C o m et  p r esen te d   a   b etter   ap p r o ac h   b y   d e v iatin g   f r o m   HT T P  m o d el  o f   C o m m u n icatio n   an d   p e r m itti n g   co m m u n icatio n   o v er   HT T P  with   p u s h - s ty le.   W ith   th e  ad v en t   o f   HT ML   5 ,   web   s o ck et  b r in g s   a b o u t   a  h i g h er   d e v elo p m e n t  th a n   Ajax   a n d   C o m et.   T h e  co n d itio n   o f   HT ML   5   W e b So ck et  d ef i n es  a  s in g le  s o ck e t  f u ll  d u p lex   ( b i - d ir ec tio n al)   c o n n ec tio n   wh ich   is   u s ed   to   p u ll  an d   p u s h   d ata  b et wee n   a  clien t  ( b r o wser )   an d   a  s er v er ,   th er e b y   d eliv er in g   a  b etter   r esu l t  th an   co m et   an d   Ajax   p o llin g   [ 3 ].     2 . 1 .   P rio r  m et ho ds   f o r  re a l t im e   da t a   co m m un ica t io n   HT T P  ca n   s im u late  r ea l  tim e  c o m m u n icatio n   en v ir o n m en t.  T h e  HT T P  lo n g   p o llin g   a n d   HT T P  p o llin g   ca n   b e  co n s id er ed   as th e  g o o d   s o lu tio n   f o r   d eliv e r in g   r ea l tim e  in f o r m atio n   [ 4 ]:     2 . 1 . 1 .   H TTP   po llin g   A  co m m o n   f ea tu r e  o f   HT T P  Po llin g   is   its   s eq u en ce   in   r eq u est  r esp o n s e  m ess ag es.  A  r eq u est  is   s en t  b y   th e  clien t to   th e  s er v e r ,   wh en   th e  s er v er   r ec eiv e  t h e  m ess ag e,   it r etu r n s   a  n ew  m ess ag e  if   th er e  is   a  m ess ag e  to   s en d   o th er wis e  an   em p ty   r esp o n s e  is   r et u r n ed   if   th er e   is   n o   m ess ag e  av ailab le.   Af ter   a   s m all  in ter m is s io n   s ay   t,  ca lled   as  p o llin g   in ter v al,   th e  s er v er   is   p o lled   ag ain   b y   c lien t  to   r ea l ize  if   th er e  is   a  v a ca n t  n ew  m ess ag e.   E x am p les o f   a p p licatio n   wh ic h   u s e  HT T P Po llin g   ar e  ch at  r o o m s   an d   g am es   in   Fig u r e   1 .   Fo r   HT T P  Po llin g   to   b e  ad eq u ate  in   p r o v id in g   r ea l  tim e  d etails,  th e  in ter v al  o f   d eliv er in g   th e  m ess ag e  m u s t  b e  k n o wn   wh ic h   im p lies   th at  th e  r ate  o f   tr a n s m itti n g   th e  d ata  m u s t  b e   s tab le.   T h u s ,   th e  clien t  will  o n ly   b e  s y n ch r o n ize d   b y   th e  a p p licatio n   d e v elo p er   to   r e q u est  f o r   d ata  wh en   it  is   ce r tain   to   b e  a v ailab le.   Ho wev er ,   laten cy   is   ac cu m u lated   w h en   t h e  r ate  o f   d ata  r eq u est  g r o ws  wh ich   i s   ca u s ed   d u e   to   th e   co n s tan t  r ep etitio n   o f   im p o r tan t h ea d er   d etails  b y   th e  o v er h ea d   i n tr in s ic  to   HT T P p o llin g .   D u e  to   th e  c o m p lex it y   o f   r ea l - tim e  HT T P   W eb   ap p licatio n s ,   it   h as  b ee n   p r o p o s ed   in   ea r ly   r esear ch   th at   HT T P  was  n o t   co n ce i v ed   f o r   r ea l  tim e  f u ll   d u p lex   co m m u n icatio n .   T h u s ,   th e  HT T P  s o lu tio n   ca n   s im u late  th e  r ea l  tim e  co m m u n icatio n   with   h ig h   tag   in   p r ice ,   in cr ea s ed   n etwo r k   tr af f ic  a n d   i n cr ea s ed   laten cy .           Fig u r e  1 .   C lien t  u s in g   HT T P  p o llin g   Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   2 2 5 2 - 8 7 7 6   I n t J I n f   &   C o m m u n   T ec h n o l ,  Vo l.  8 ,   No .   3,   Dec  2 0 1 9   :  1 3 9   –   151   142   2 . 1 . 2 .   H T T P   lo ng   po llin g   A  f law  in   p o llin g   is   th e  lar g e   a m o u n t  o f   f u tile  r e q u est  it  s en t  to   th e  s er v er   wh e n   it  d o es  n o t h av e  n ew   m ess ag e  f o r   a  clien t.  T h er ef o r e,   th e  d etails wh ich   ar e  p u s h ed   f o r m   s er v er s   to   clien t a r e  we ll h an d led   b y   HT T P   L o n g   p o llin g   w h ich   is   a  v ar iat io n   o f   p o lli n g   [8 ] .   W ith   HT T P  lo n g   p o llin g   as  s h o w n   as  Fig u r e  2 ,   wh en   th e r e  is   n o   n ew  m ess ag e  to   b e  s en t  to   th e  clien t,  th e  s er v er   d o es  r e p ly   with   an   em p t y   m ess ag e  b u t  in s tead   k ee p   th e   r eq u est  u n til  a  f r esh   m ess ag e  is   av ailab le  t o   b e  s en t   to   th e   clien t  o r   tim eo u t  o cc u r s   t h er eb y   d ec r ea s in g   th e   n u m b er   o f   p o in tles s   r eq u est  t o   th e  s er v er   b u t   s till   HT T P  L o n g   p o llin g   d id   n o t   s o lv e  t h e  p r o b lem   in   tr ad itio n al   p o llin g   as th er e  is   s till   in cr ea s ed   laten cy   an d   o v er h ea d .             Fig u r e  2 .   C lien t  u s in g   lo n g   p o l lin g       2 . 1 . 3 .   H TTP   s t re a m ing   HT T P  Stre am in g   wh ich   was  f i r s t  m ad e  k n o wn   to   th e  web   b y   Netscap e  in   1 9 9 2   o r ig in ates  in   two   k in d s   n am ely   p ag e   s tr ea m in g   an d   s er v ice  s tr ea m in g .   T h e  co n ten t  o f   th e  s er v er   s tr ea m in g   in   a  lo n g - liv e d   HT T P   C o n n ec tio n   is   co n tain ed   in   p a g e  s tr ea m in g   as we ll a s   s er v ice  s tr ea m in g   [ 9 ] .   W ith   HT T P S tr ea m in g ,   th e  s er v er   d o es  n o t  clo s e  th e  co n n ec tio n   b u t  k ee p s   it  o p en   th r o u g h o u t  a  clien t  s ess io n   b y   r u n n in g   a  lo n g   lo o p .   A  ch an g e   in   s tate  is   d etec ted   b y   th e  s er v er   s cr ip t  u s in g   s o m e  m eth o d s   l ik e  ev en t   r eg is tr atio n .   O n ce   a  ch an g e  is   d etec te d ,   th e  n ew  d ata  is   s tr ea m ed   a n d   f lu s h ed   wh ile  th e   co n n ec tio n   r e m ain s   o p en .   Fo r   th e  m ea n tim e ,   th e  n ew  d ata  m u s t   b e  d is p lay ed   in   th e  u s er   in ter f ac e  wh ile  awa itin g   th e  s er v er ’ s   r esp o n s e  [ 9 ] .   A  d if f er en ce   b etwe en   th e  f o r m s   o f   s tr ea m in g   is   th at  s er v ice  s tr ea m in g   is   in itialized   b y   clien t’ s   r eq u est  wh ich   is   k n o wn   as  X HR - s tr ea m in g   wh ile  p ag e  s tr ea m in g   u s es  th e   r eq u e s t  o f   th e   in itial  p a g e  to   s tr ea m   d ata  wh ic h   p r o v i d e  f lex i b ilit y   in   th e  d u r atio n   o f   co n n ec tio n   [ 4 ] .   An   e x am p le   o f   HT T P  Stre am in g   im p lem en t atio n   is   Fo r ev er   f r am e   ( an   if r am e  wh ich   o b tain s   s cr ip t  tag s   f r o m   a  s er v er   in   a n   ev er last in g   r esp o n s e)   w h ich   is   s h o wn   in   Fig u r e  3 .   C o d es  ar e  im p lem en te d   in   s cr ip t  tag s   wh en   it  is   b ee n   r ea d   b y   a  b r o wser ,   th er e f o r e  th e  d at a  r ec eiv ed   b y   a  clien t  f r o m   th e  s er v er   ar e  en cl o s ed   as  J av aScr ip t  f u n ctio n s   [ 5 ].   C o m p ar is o n   b etwe en   HT T P  lo n g   p o llin g   an d   HT T P  s tr ea m in g   p r o to co ls   as  s h o w  in   T ab le  1 .           Fig u r e  3 .   HT T P st r ea m in g         Evaluation Warning : The document was created with Spire.PDF for Python.
I n t J I n f   &   C o m m u n   T ec h n o l   I SS N:  2252 - 8 7 7 6       F in a n cia l sto ck   a p p lica tio n   u s in g   w eb s o ck et   in   r ea l time   a p p lica tio n   ( Yin ka - B a n jo   C h ika )   143   T ab le  1 .   C o m p a r is o n   b etwe en   H TTP   lo n g   p o llin g   an d   H TTP   s tr ea m in g   p r o to co ls   H TTP  l o n g   p o l l i n g   H TTP  st r e a mi n g   W i t h   H T TP  l o n g   p o l l i n g   w h e n   t h e r e   i s  n o   n e w   mess a g e   t o   b e   sen t   t o   t h e   c l i e n t .   W i t h   H TTP   S t r e a mi n g ,   t h e   s e r v e r   d o e s  n o t   c l o se  t h e   c o n n e c t i o n   b u t   k e e p s  i t   o p e n   t h r o u g h o u t   a   c l i e n t   sessi o n   b y   r u n n i n g   a   l o n g   l o o p .   Th e   s e r v e r   d o e s  r e p l y   w i t h   a n   e mp t y   messa g e   b u t   i n st e a d   k e e p   t h e   r e q u e st   u n t i l   a   f r e s h   me ssa g e   i s  a v a i l a b l e   t o   b e   s e n t   t o   t h e   c l i e n t   o r   t i me o u t   o c c u r s   t h e r e b y   d e c r e a s i n g   t h e   n u m b e r   o f   p o i n t l e ss  r e q u e s t s   t o   t h e   serv e r   A   c h a n g e   i n   st a t e   i s  d e t e c t e d   b y   t h e   s e r v e r   scr i p t   u si n g   so me  m e t h o d s  l i k e   e v e n t   r e g i st r a t i o n .   O n c e   a   c h a n g e   i s  d e t e c t e d ,   t h e   n e w   d a t a   i s  st r e a me d   a n d   f l u s h e d   w h i l e   t h e   c o n n e c t i o n   r e m a i n s  o p e n       2 . 1 . 4 .     C o m et   C o m et  s ch em e  wh ich   ex is t  d u e  to   t h e  p er s is ten ce   attr ib u te  o f   HT T P/1 . 1   u s es  th e   m eth o d s   p r ac ticed   b y   lo n g   p o llin g   to   ac co m p lis h   r ea l  tim e  b eh av io r   [ 1 0 ] .   B ef o r e  th e  ad v en t  o f   p er s is ten ce   co n n ec tio n ,   d if f er e n t   UR L S  ar e  b ee n   f etch ed   b y   d i f f er en t  T C P  co n n ec tio n   wh ic h   ca u s e  co n g esti o n   o n   th e  in t er n et  b ec au s e  o f   t h e  w eig h t  b ein g   p u t  o n   th e  s er v er   b u t  with   p e r s is ten ce   co n n e ctio n   th e  co n n ec tio n   b etwe en   th e  clien t  an d   th e   b r o wser   ar e  alwa y s   o p en   till   it   is   clo s ed   b y   eith er   o n e  o f   th e  p ar ty   s en d in g   a  p r ec is e  clo s e  co n n ec tio n   m ess ag e   o r   a  tim e/n etwo r k   er r o r   ta k e  p lace .   As  s o o n   as  th e  co n n ec tio n   is   clo s ed ,   th e  s er v e r   ca n n o t  s tar t  it  b ac k   to   g ai n  a  co n n ec tio n   to   th e  b r o wser   [ 5 ].   W ith   p er s is ten ce   co n n ec tio n ,   C PU  tim e  i s   s av ed   in   b o th   h o s ts   an d   r o u ter s ,   f ewe r   T C P  co n n ec tio n s   ar e  o p en ed   an d   cl o s ed   an d   t h e  m e m o r y   u s e  in   th e  co n tr o l b l o ck s   o f   th e  T C P Pr o to co l c a n   b e  s a v ed   in   h o s ts .     2 . 1 . 5 .   Serv er - s ent   ev ent s   Ser v er   s en t E v en t  u s es th e  tex t /ev en t stre am   f ea t u r e  o f   HT T P/1 . 1   c o n ten t t y p e  t o   s en d   m ess ag e  to   th e   b r o wser   ( clien t) .   T h e  ch an n el  in   wh ich   s er v er - s en t  ev en t u s e  to   co m m u n icate   to   th e   clien t f r o m   th e   s er v er   is   a   one - way   co m m u n icatio n   ch an n el.   Ho wev er ,   th e  clien t  h as  to   s u b s cr ib e  to   th e  ch an n el  b y   f ir s t  co n n ec tin g ,   th e n   wh en   th er e  is   a  f r esh   in f o r m a tio n   av ailab le  th e  s er v er   p o s t  ev en ts .   T h e  co n n ec tio n   is   alwa y s   o p en   u n til  it  is   clo s ed   b y   a  p r o x y   o r   th e  clien t   its elf .   T h e  co n n ec tio n   ca n   also   b e  co n f ig u r ed   to   clo s e  af ter   a  d u r atio n   o f   tim e,   s am e  as  th e  clien t  r ec o n n ec tio n   tim e  [ 3 ] .   As  s h o wn   in   Fig u r e  4 ,   Ser v er   s en t  E v en ts   b e h av es  q u ite  lik e  lo n g - p o llin g .   Ser v er - s en t  ev e n ts   ca n   b e  u s ed   b y   d ev el o p er s   to   ac ce s s   API s .   E v en t  So u r ce   in ter f ac e  r ec eiv e  ac ce s s   f r o m   t h e  API   t h er eb y   p r o v id in g   a  d ir ec t  J av aScr ip t   co d e,   allo win g   e v en ts   to   b e  tr i g g er ed   b y   th e   s er v e r     to   th e  b r o wser   an d   u p d at in g   t h e  co n ten t  o n   th e  clien t  [ 1 0 ] .   W h en   an   I D  is   s et  o n   m ess a g es  s en t,  th e  clien t     r ec o n n ec ts   a n d   co n tin u e  wh er e  it st o p s   af ter   a   lo o k   u p   is   b ee n   d o n e  b y   th e  s er v er   o n   its   I D.   T h is   f ea tu r e  m a k es  s er v er   s en t e v en t r o b u s t.           Fig u r e  4 .   C lien t  u s in g   s er v e r   s en t e v en ts       T h e  m o d el  in   wh ic h   clien t - s i d e  ev en ts   ar e   tr an s m itted   to   th e  s er v er   ( i.e .   a   u s er   click s   o n   a  lin k   to   r eq u est  a  n ew  p ag e  f r o m   t h e  s e r v er )   ca n   b e   r ef er r ed   to   as  “c lien t - s en t  ev en ts ”.   Ser v er - s en t  ev en ts   p er m its   s er v er s   to   p ass   in f o r m atio n   to   th e  clie n t  as  it  b ec o m es  ac ce s s ib le,   wi th o u t  clien t   p o llin g .   T o   u s e  Ser v er   Sen t   E v e n ts ,   an   ap p licatio n   im p lem en ts   an   E v en t So u r ce   API   in   th e  b r o wser   an d   p u s h es d ata  f r o m   th e  s er v er   with   Ser v er   Sen t   E v en t’ s   ev en t stre am   d ata  f o r m at.     2 . 2 .   Dra wba ck s   o f   re a l  t im e  web  wit h H T T P   -   O v er hea d   Ach iev in g   r ea l  tim e  with   HT T P  is   a  n aïv e   ap p r o ac h   b ec au s e  HT T P  h ea d er s   co n s u m e  e x ce s s   d ata   wh ich   is   in   m o s t  ca s e   n o t   u s ef u l  f o r   r ea l   tim e  a p p licatio n   wh ile  W eb So ck et  p r o to co l   is   in te n d ed   f o r   it b ec au s e  it  m ak es  av ailab l e  a   b id ir ec tio n al,   f u ll - d u p lex   co m m u n icatio n   ch an n el  f o r   u s e  wh ich   is   ca r r y   o u t  with   a   s in g le   s o ck et  lead in g   to   a   s ca lab le  r e al  tim e  W eb   ap p licatio n .   Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   2 2 5 2 - 8 7 7 6   I n t J I n f   &   C o m m u n   T ec h n o l ,  Vo l.  8 ,   No .   3,   Dec  2 0 1 9   :  1 3 9   –   151   144   -   Unid irec t io na l   HT T P  is   u n id ir ec tio n al  s o   wh en   u s in g   r ea l   tim e  a p p licatio n   with   HT T P,   s ev er al  T C P  co n n ec tio n   is   u s ed   to   ac h iev e   a   r ep licated   bi - d ir ec tio n al   co m m u n icatio n   [ 1 1 ] ,   e v en   with   s er v e r   s en t   ev en t ,   a  c o n n ec tio n   will   s till   b e  n ee d ed   to   p u s h   ev e n ts   f r o m   th e  s er v er   to   t h e  clien t  an d   also   to   s en d   m ess ag e  to   th e   s er v er   b u t   W eb So ck et  p r o to co l   wh ich   b r i n g   im p r o v em en t  t o   r ea l   tim e  a p p licat io n s   is   p u r p o s ely   f o r   th e   ai m   o f   b i - d ir ec tio n al  co m m u n icatio n   wh ich   r ea l   tim e  ap p licatio n   is   all  ab o u t.     2 . 3 .   W eb   s o ck et     C o m m u n icatio n   o v er h ea d   ca n   b e   in ten s if ied   b y   th e  u s e  o f   c o n tin u o u s   p o llin g   in   an   ap p licatio n .   T h e   W eb So ck et  p r o t o co l  allo ws  f o r   a   r o b u s t  r ea l   tim e  web   a p p licatio n   b ec au s e  it  p r o v id e s   a  f u ll - d u p lex   b i - d ir ec tio n al  co m m u n icatio n   ch an n el  wh ich   is   d o n e  with   a  s in g le  s o ck et  [ 7 ].     2 . 3 . 1 .   Web  s o ck et   a rc hite ct ure   Fig u r e  5   d ep icts   th e  ar ch itectu r e  o f   W eb So ck et.   W eb So c k e t  p r o to c o l  co n s is t  o f   two   ca te g o r ies;   th e   f ir s t  p ar t  is   th e  Han d s h ak e  w h ich   co n tain s   th e  h an d s h a k e  r esp o n s e  f r o m   th e  s er v er   a n d   th e  m ess ag e  f r o m     th e  clien t,  th e  s ec o n d   o f   t h e  ca teg o r y   is   d ata  tr an s f er .   T h e   W eb   s o ck et  also   p r o v id e  a  s o ck et  th at  is   in n ate     to   th e  b r o wser   wh ich   elim in ate  m o s t  o f   th e  p r o b lem s   with   u s in g   HT T P  th er e b y   b u ild in g   a   s ca lab le    r ea l tim e  ap p licatio n .   Fo r   a  W eb So ck et   co n n ec tio n   to   b e   estab lis h ed ,   b o th   t h e  s er v er   an d   clien t   h as  to   b e   u p g r a d ed   f r o m   HT T P  p r o to co l  to   web   s o ck et  p r o to co l   at  th e  ea r ly   s tag e  o f   h a n d s h ak e.   W h en   th e  c o n n ec tio n   h as  b ee n   estab lis h ed ,   W eb So ck et  d ata,   t ex t  an d   b in ar y   f r am e   ca n   b e   s en t  at  th e  s am e  tim e  in   a n y   d ir e ctio n   in   f u ll  d u p le x   m o d e.   R ep licatin g   th e  W eb So ck et  b i - d ir ec tio n al  c o m m u n icatio n   with   HT T P  co m es  with   h ig h   p r ice  to   p ay   in   s lo w  C PU  p er f o r m an ce ,   in cr e ased   laten cy   an d   n etwo r k   tr af f ic  an d   ca n   b e  v e r y   d if f icu lt  an d   is   er r o r   p r o n e   b ec au s e  o f   th e   co m p lex ity   ass o ciate d   with   r ea l  tim e   ap p licat io n   [ 1 2 ] .   An o th er   b en e f it  o f   W eb So ck et  is   th at  it   h as  th e  ab ilit y   to   t r a n s v er s e  p r o x y   an d   f ir ewa ll  wh ic h   is   an   ar ea   d if f icu lt  f o r   m an y   ap p licatio n s .   W eb So ck et   p ass   b y   p r o x y   b y   s p o n tan eo u s l y   s ettin g   u p   a  t u n n el  wh e n   it d etec ts   th e  p r esen ce   o f   a  p r o x y   s er v er .             Fig u r e  5 .   W eb   s o ck et  a r ch itectu r e       3.   RE SU L T S  A ND  D I SCU SS I O N    3 . 1 .   F ea t ures o f   t he  s y s t em   T h e  u s er   in ter f ac e  o f   th e  a p p li ca tio n   in clu d es  th e  f in an cial  a p p licatio n   d ash b o ar d ,   th is   p ag e  co n tain s   an   ea s y   ac ce s s   lin k   to   s o m e   f u n ctio n al  p a g e  s u ch   as  th e   co m p a n y   h o ld in g   m o d u le,   t h e  f in a n cial  s to ck   ap p licatio n   lis t  m o d u le  a m o n g   o th er s .   T h e  lis t  o f   f u n ctio n ali ties   an d   f ea tu r es  th at  a r e  u s ed   in   th is   a p p licatio n   ar e  d is cu s s ed   b elo w.     3 . 1 . 1 .   F ina ncia l  s t o ck   a pp lica t io n da s hb o a rd   T h is   f in an cial  s to ck   ap p licatio n   d ash b o ar d   co n tain s   th e  s h o r t   cu t  m en u   f o r   m o s t  o f   th e  m o d u le  in   th e  ap p licatio n .   T h e   m o d u les th at  ex is ts   in   th is   d ash b o ar d   ar e   lis ted   an d   e x p lain ed   b elo w:   -   T h er e  is   th e  d ash b o ar d   ic o n   w h ich   co n tain s   h y p er lin k   f o r   th e   d ash b o ar d   an d   th u s   r ed i r ec ts   b ac k .   -   T h e  d ash b o ar d   also   co n tain s   an   ico n   wh ich   r ed ir ec t  to   th e  m o d if y   Sto ck   a p p lic atio n   m o d u le     wh en   click ed   o n .   Evaluation Warning : The document was created with Spire.PDF for Python.
I n t J I n f   &   C o m m u n   T ec h n o l   I SS N:  2252 - 8 7 7 6       F in a n cia l sto ck   a p p lica tio n   u s in g   w eb s o ck et   in   r ea l time   a p p lica tio n   ( Yin ka - B a n jo   C h ika )   145   -   T h er e  is   also   an   ico n   f o r   My   h o ld in g   p ag e  wh ich   lis t th e  co m p an y   s to ck .   -   T h e  in d ex   p ag e  w h ich   co n tain s   all  th e  co m p an y   an d   t h eir   s to ck   ico n   is   also   in clu d e d   in   th e   d ash b o ar d .   -   T h e  d ash b o ar d   h as th e  s id e  b a r   wh ich   co n tain   th e  f o llo win g   ac tio n   lin k s :   -   Dash b o ar d   lin k   -   My   h o ld in g s   -   Sto ck   Ap p licatio n   L is t   -   Mo d if y   s to ck     -   T h er e  is   th e  Sear ch   in p u t f ield   lo ca ted   in   th e  to p   p ar t o f   t h e  s id e  b ar   wh ich   allo ws s ea r ch es.   W h en   a  wo r d   is   in p u tted   in   th e  in p u t  f ield   f o r   th e  p u r p o s e  o f   s ea r ch in g ,   th e   r esu lt  s h o u ld   b e  ab le  to   b e  f ilter ed   ac co r d i n g   to   d escr ip tio n   o f   th e  u s er   s ea r ch .     3 . 1 . 2 .   M o dify   s t o ck  m o du le   I n   th is   m o d u le,   t h e  p r e v io u s   s t o ck   o f   a  c o m p an y   ca n   b e   u p d ated ,   th e  p ag e  c o n tain s   th e   co m p an y   n a m e,   th e  cu r r e n t  s to ck   p r ice,   th e  c o m p an y   i n itial  o p en in g   p r ice ,   th e  s y m b o l  wh ich   is   u s ed   in   id e n tify in g   th e  c o m p a n y ,   th e  last   p r ev io u s   p r ice  o f   th e   c o m p an y ,   th e   n et  ch an g e  an d   th e  p er ce n tag e  c h an g e .     T h e  co m p an y   d etails  an d   n ec e s s ar y   in f o r m atio n   ar e   f etch in g   wh en   th e   u s er   lo g   in   with   th e   c r ed en tials   in   to   a  f o r m   in p u t  f ield   th at  h as   m atch in g   f ield s   with   th e  d atab ase.   T o   u p d ate  th e  co m p an y ’ s   n ew  s to ck ,   th e  u s er   en ter s   th e  n ew  p r ice  in   th e  s to ck   f ield   s ec tio n ,   th e  n et  ch an g e  an d   p er ce n tag e  ch a n g e  ar e  u p d ated   im m ed iately .   T h e  m o d u le  s h o ws  th e  s to ck   an d   co m p an y   d ep en d en cy   an d   u s er s   s h o u ld   b e  ab le  t o   m an ag e     th eir   s to ck   ef f ec tiv ely .   Af ter   t h e  u s er s   en ter   th e  p r ice,   th e   n e w  p r ice  is   im m ed iately   ca p tu r ed   b y   th e  Pre v C lo s e   ( Pre v io u s   clo s e)   f ield   a n d   ca lc u latio n s   ar e  m ad e  with   b o th   v alu es.   E ac h   f ield   ( Net  ch an g e  an d   %  ch an g e)   ar e  g o tten   f r o m   th e  ca lcu latio n s   o f   th e  n ew  s to ck   v alu e  an d   th e   Pre v C lo s e  v alu e.     T h e  Net  ch a n g e  an d   %  ch an g e  s h o ws  a  m o n ito r   as  to   th e  p o s itiv e  o r   n e g ativ e  ch an g e  o f   th e   co m p an y   s to ck ,   c o lo r   r ed   w h ich   in d icate   lo w   s to ck   an d   g r ee n   d en o tes  p o s itiv e.     W h en   th e  u s er   s av es  th e  n ew   v alu es,  th e  f in a n cial  s to ck   in d ex   p ag e  is   u p d ated   im m e d iately .     3 . 2 .   T ec hn o lo g y   o v er v iew   Mic r o s o f t’ s   . NE T   f r am ewo r k   ( Mic r o s o f t,  2 0 1 7 )   was  u s ed   t o   i m p lem en t  th e   f in a n cial  s to ck   s y s tem   an d   th e  ch o ice   o f   lan g u ag e   was  C # .   T h e  p latf o r m . NE T   f r am ew o r k   m ain   tar g et  is   Mic r o s o f t  win d o ws  b u t   o th e r   p latf o r m   also   in clu d es  L in u x ,   Mo n o   wh ich   is   f r e e  an d   an   o p en   s o u r ce   im p lem en tatio n   o f   . NE T   f r am ewo r k   ( Xam ar in ,   2 0 1 3 ) ,   with   Mo n o ,   d if f er en t simu lato r   co m p o n e n t   ca n   b e  p r o ce s s ed   o n   d if f e r en t  p latf o r m s .   Fo r   th is   p r o ject,   th e  s im u lato r   u s ed   b etwe en   th e  f in an cial  s to ck   s i m u lato r   an d   th e  ag e n ts   is   S i g n alR   W e b So ck et  im p lem en tatio n   ( Sig n alR ,   2 0 1 7 )   an d   th is   f o s ter   th e  co r e  co m m u n icatio n .     -   M icro s o f t   . NE T   f ra m ewo rk   Mic r o s o f t  . NE T   f r am ewo r k   i s   k n o wn   as  a  s o f twar e  th at  aid s   d ev elo p m en t  a n d   th er e b y   u s ed   its   en v ir o n m en t,  m an y   lan g u ag es  s u ch   as C 3 ,   C ++   an d   v is u al  b a s ic  u s es it b ec au s e  it su p p o r ts   m an y   la n g u a g es.  I t   is   d iv id ed   in to   r u n   tim e  c o m p o n en t a n d   co m p ile  tim e  co m p o n en ts .     -   WebSo ck et   W eb So ck et  p r o to co l  co n s is t  o f   two   ca teg o r ies;   th e  f ir s t  p ar t  is   th e  Han d s h ak e  wh ich   co n tain s   th e  h an d s h ak e   r esp o n s e  f r o m   th e   s er v er   a n d   t h e  m ess ag e  f r o m   th e  clien t,  th e   s ec o n d   o f   th e  ca te g o r y   is   d ata  tr a n s f er .   T h e  W eb   s o ck et  also   p r o v id e  a  s o ck et  th at  is   in n ate  to   th e  b r o wser   wh ich   elim in ate  m o s t o f   th e  p r o b lem s   with   u s in g   HT T P th er eb y   b u ild i n g   a  s ca lab le  r ea l tim e  ap p licatio n .     -   Sig na lR   Fo r   Mic r o s o f t w eb /ASP . NE T   tech n o lo g y ,   Sig n alR   is   u s ed   in   ca r r y in g   o u t Web So ck et  o p e r atio n s .   An   OW I N  Pro ject  wh ich   is   k n o w n   as  a   co n tai n er   is   b ein g   im p l em en ted   o n   a  web s er v er   w h ich   is   ess en tial  wh e n   u s in g   Sig n alR .   T h e  c o m m u n ic atio n   p atter n   u s ed   in   W eb So ck et  h as  alr ea d y   b ee n   d escr ib e d   i n   ch a p ter   two ;   T h e   b r o wser   f ir s t  s en d s   a  W eb So c k et  co n n ec tio n   r eq u est,  in   wh i ch   th e   b r o wser   r esp o n d s   to   th e   r eq u est  s en t  b y   th e   clien t,  th e  p r o ce s s   d escr ib ed   a b o v e  is   k n o wn   as  ‘ h an d s h ak e ’ .   T h e   d ata  tr a n s m is s io n   at  th is   p h ase  is   b ased   o n   tex t a n d   u s e  ASC I I   en co d in g   a n d   is   co m p atib le  with   e x is tin g   HT T P/1 . 1   p r o to co ls .       3 . 3 .   RE SU L T S   3 . 3 . 1 .   F ina ncia l  s t o ck   a pp lica t io n  da s hb o a rd    T h e   Sto ck   Ap p licatio n   d ash b o ar d   s h o ws  a   b r ief   la y o u t   o f   th e  p r o ject  an d   also   i n clu d e   lin k s   to   s o m e   m o d u le  an d   was n o t d ev elo p e d   to   h av e  an y   f u n ctio n ality .   T h er e  ar e  f o u r   ico n s /co lu m n s   in   th e  Fin an cial  Sto ck   Ap p licatio n   d ash b o a r d   m o d u l e  as  s h o wn   in   Fig u r e  6 ,   th e  f i r s t  co lu m n   s h o ws  a  h y p er lin k   wh ich   lin k s   to   th e  Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   2 2 5 2 - 8 7 7 6   I n t J I n f   &   C o m m u n   T ec h n o l ,  Vo l.  8 ,   No .   3,   Dec  2 0 1 9   :  1 3 9   –   151   146   f in an cial  s to ck   ap p licatio n   p ag e  wh er e  all  th e  co m p an y   a n d   t h eir   s to ck   ca n   b e  s ee n .   T h e  s ec o n d   co l u m n   c o n tain   a  lin k   to   m o d if y   a  co m p an y   p r ev io u s   ap p licatio n   wh ich   in cl u d es  th e  u n it  p r ice,   q u a n tity ,   p r ev io u s   clo s e,   n et   ch a n g e  p er ce n tag e  c h an g e.     T h e  th ir d   ico n   c o n tain   a  h y p er lin k   to   th e  d etails  m o d u le  wh ich   s h o ws  th e  d etails  o f   a  r eg is ter ed   co m p an y   an d   its   s to ck   wh ile  th e  f o u r th   co l u m n   s h o ws an   ic o n   wh ich   is   a  lin k   to   th e  v iew  d etail  m o d u le.           Fig u r e  6 .   Dash b o ar d       3 . 3 . 2 .   L o g in pa g e   Fig u r e  7   s h o ws th e  lo g in   p a g e  wh er e  th e  u s er   c r ed en tials   ar e  en ter ed   to   ac ce s s   th e  ap p licatio n .           Fig u r e  7 .   L o g in   p ag e       3 . 3 . 3 .   Reg is t er   co m pa ny   a pp lica t io n m o du le    T h is   m o d u le  as sh o wn   in   F ig u r e  8   co n tain s   th e   r eg is tr atio n   o f   u s er s ,   t h er e  a r e  t h r ee   r o les co n tain ed   i n   th is   p r o ject,   wh ich   ar e   lis ted   an d   ex p lai n ed   b el o w:            Fig u r e  8 .   R eg is ter   co m p an y   Evaluation Warning : The document was created with Spire.PDF for Python.
I n t J I n f   &   C o m m u n   T ec h n o l   I SS N:  2252 - 8 7 7 6       F in a n cia l sto ck   a p p lica tio n   u s in g   w eb s o ck et   in   r ea l time   a p p lica tio n   ( Yin ka - B a n jo   C h ika )   147   3 . 3 . 4 .   M y   s t o ck   m o du le   As f o r   th e  ‘ My   Sto c k   d ash b o a r d ,   it   co n s is ts   o f   th e   m o d if y   St o ck   m o d u le   an d   d etail  m o d u le .   So ,   wh en   a  co m p a n y   ch an g es  its   s to ck   o n   My   h o ld in g s   m o d u le   wh ich   is   b ee n   d is p lay e d   in   Fig u r e  9 ,   it  r e f lects  im m ed iately   in   th e  s to c k   ap p licatio n   lis t  m o d u le  with o u t  t h e   u s er s   h av i n g   to   r ef r esh   t h eir   p ag es.  T h is   Mo d u le   is   ar r an g ed   f o llo win g   th e  p r esu m ed   u s er   wo r k   f lo w.   R ig h t  b esid e  th e  Ap p licatio n   s y m b o l,  th er e   is   th e  NetCh an g e  an d   Per ce n tag eCh an g e  co l u m n   r ef lectin g   th e  c h an g e  in   v alu e   an d   in   p er ce n ta g e  in   th e   s to ck   p r i ce  o f   th e  co m p an y .           Fig u r e  9 .   Ad d   / c h an g e  s to ck   a p p licatio n       3 . 3 . 5 .   Sto ck   a pp lica t io n lis t   m o du le   T h e  s to ck   ap p licatio n   lis t  s h o ws  th e  latest  s to ck   in   d y n am i c  m an n e r ,   Fig u r e  1 0   illu s tr ate s   th e  s to ck   p r ice  s er v er   waitin g   f o r   a v ailab le  s o ck et   h er ea f ter   I n f o r m atio n   o f   t h e  r eg is ter ed   c o m p a n y ’ s   s to ck   ar e   g o tten   i n   r ea l  tim e.   T h is   m o d u le  c o n tai n s   all  co m p an y   an d   th eir   s to ck   th at  h as  b ee n   s et  liv e  b y   th e   ad m in .   T h is   m o d u le   also   h as  th e  h ig h est  f u n ctio n al ity   o f   th e  s y s tem   an d   it  is   in   th i s   m o d u le,   W eb So ck et  r e al  tim e  f ea tu r e  is   ap p lied .   T h is   s to ck   p r ice  s er v er   s u b s cr ib es  to   a  b r o k er   b ac k en d   f o r   s to ck   p r ice  u p d a tes.  W h en   th e  s to ck   p r ice  s er v er   r ec eiv es  p r ice  u p d ates  f r o m   th e  b ac k en d ,   it  b r o ad ca s ts   th ese  to   all  clien ts .   T h e  f ield s   s h o wn   in   Fig u r e  1 1   a r e   in clu d ed   in   th e  s to ck   ap p licatio n   lis t.           Fig u r e  1 0 .   W aitin g   f o r   a v ailab le  So ck et           Fig u r e  1 1 .   S to ck   a p p licatio n   lis t       a)   C o m p an y   n a m e   T h e  co m p a n y   f ield   is   an   in p u t   f ield   th at  ac ce p t  v alu e  f r o m   t h e  u s er   in   tex t  f o r m at,   o n   th e  cr ea tio n   o f   th e  co m p an y ,   th e  u s er   wo u ld   b e  allo wed   to   in p u t  th e  n am e  with   th e  g iv en   f ield   p r o v id e d   b u t  o n   u p d atin g   t h e  s to ck   th e  c o m p a n y   in p u t   f ield   is   n o t m a d e  a v ailab le  s in ce   it   h as b ee n   p r e v io u s ly   en ter ed   b u t r ea d   to   u s er   i n   th e   m o d u le,   th e  co m p an y   n am e  f i eld   o n   th e  d atab ase  is   s to r ed   as  a  v ar ch ar   ch ar ac ter   wh ich   allo w  lar g er   len g th   to   ac co m m o d ate  a   p o s s ib ilit y   o f   a  lo n g   u s er   n am e  th e r eb y   allo win g   f o r   b etter   u s er   e x p er ien c e.   Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   2 2 5 2 - 8 7 7 6   I n t J I n f   &   C o m m u n   T ec h n o l ,  Vo l.  8 ,   No .   3,   Dec  2 0 1 9   :  1 3 9   –   151   148   b)   Sy m b o l   T h is   in p u t  f ield   c o n tain s   th e  s y m b o l  th e  u s er   c h o o s es  as  th e  ap p licatio n   f o r   its   co m p an y ,   o n   r e g is tr atio n   o f   th e  co m p an y ,   th e  in p u t  f ield   is   also   m ad e  b lan k   f o r   th e  u s e r   to   p u t  in   its   ap p licatio n   c h o ic e  b u t  o n   l o g   in ,   th e   in p u t  f ield   is   n o t   ed itab le   b u t d is p lay ed   o n   th e   u s er   p ag e,   th e  p r o p er ty   o f   th e  s y m b o l o n   th e  d atab ase  is   also   o f   ty p e  v ar c h ar   to   allo w  f o r   a   lar g er   f ield .     c)   Sto ck   p r ice    T h is   f ield   co n tain s   th e  s to ck   p r ice  o f   th e  co m p an y ,   th e  f ield   p r o p er ty   o n   th e  d ata b ase  is   o f   ty p e  v ar ch ar .   On   r eg is ter in g   th e  co m p an y   is   allo wed   to   in p u t  th e  p r ice  o f   th e  s to ck ,   th e  f ield   is   also   m ad e  ed itab le  o n   u p d atin g   o f   th e  s to ck   p r ice.     d)   Pre v io u s   c lo s e   T h e  p r ev io u s   clo s e  f ield   is   an   in p u t  f iel d   th at   co n tain s   th e  p r ev io u s   p r ice  th e   s to ck   o f   a  co m p an y   was  s o ld ,   o n   r eg is ter in g   th e   f ield   i s   m ad e  in - ed itab le  as  th e   s to ck   p r ice  will  b e  u s ed   as  th e  p r e v io u s   clo s e  p r ice  o f   th e  co m p a n y ,   o n   u p d atin g   o f   s to ck ,   th e  p r ev io u s   clo s e  f ield   i s   also   m ad e  in - ed itab le,   t h e  p r o p er ty   u s ed   o n   t h e   d atab ase  f o r   th is   f ield   is   v a r ch ar .     e)   Net  c h an g e   T h e  NetCh an g e  f ield   o n   th e  d atab ase  is   o f   p r o p er ty   v ar c h ar ,   th is   is   th e  ca lcu lat io n   o f   th e   co m p an y   cu r r en t  s to ck   p r ice  an d   th e  p r ev io u s   clo s e,   o n   r eg is ter in g ,   t h is   f ield   is   m ad e  in - ed itab le  a s   th e  ca lcu lat io n   i s   m ad e  b y   s y s tem   b ased   o n   t h e   in p u t   f ield   o f   th e   cu r r e n t  s to ck   p r ice   an d   th e   p r ev io u s   clo s e,   s am e  m eth o d   is   ap p lied   o n   th e  u p d ate  s to ck   m o d u le.     f)   Per ce n tag e  c h an g e    T h is   is   th e  ca lcu latio n   in   p er ce n tag e  o f   t h e  ch an g e  in   th e   p r e v io u s   p r ice  a n d   cu r r en t sto ck   p r ice.     T h is   is   s to r ed   in   v a r ch ar   i n   t h e  d atab ase  an d   also   m a d e  i n - ed itab le  an d   ca lcu lated   b y   th e  s y s tem   b o th   o n   r eg is ter in g   o f   a  n ew  co m p an y   an d   o n   u p d atin g   o f   th e   s to ck .     3 . 4 .   Netwo r k   test   Fig u r e  1 2   s h o ws th e  n etwo r k   test   d is p lay ed   in   th e  clien t sid e,   it sh o ws th at  W eb So ck et  p r o t o co l w as  u s ed   at  th e  tr an s p o r t la y er   o f   t h e  Sto ck   ap p licatio n   ap p licati o n .           Fig u r e  1 2 .   Netwo r k   test       3 . 5 .   Co m pa ra t iv e   re s ult  a na ly s is   o f   webso ck et   wit h o t her  re a l   t im e  m et ho ds   3 . 5 . 1 .   L ess   o v er hea d    An   is s u e  ass o ciate d   with   HT T P  m eth o d s   is   th e  h u g e  v o lu m e  o f   h ea d er   d ata  ac c u m u lated   wh en   s en d in g   m esag es  b u t  d u e  to   th e   f ac t  th a t  W eb s o ck et  is   s tatef u l,  m ess ag s   ca n   b e  s en t  in   s m all  s izes.  I n   th e  f i n an cial  s to ck ,   Up d atin g   th e  ap p licatio n   p r ice   is   d en o ted   w ith   a  5 8   b y tes  J S ON  o b ject  wh ich   h as  s ev en   at tr ib u tr es  ( co m p a n y   n am e,   s to ck   tick er ,   s to c k   p r i ce ,   o p en in g   p r ice,   p r ev   clo s e,   n et  ch an g e,   %  ch an g e ) ,   T h e  b elo w  s h o ws  th e   d if f er en ce   with   o th er   m eth o s   a r e  co m p a r ed   with   W eb So ck et   Evaluation Warning : The document was created with Spire.PDF for Python.