Coder Social home page Coder Social logo

bulletin-boards's Introduction

AM      :1115201300143
ONOMA   :Manwlhs Pitsikalhs

To programma kanei oti zhthtai sthn ekfwnhsh opws kai to bash script pou zhthjhke

kefalida mhnymatwn:
--H epoikinwnia metaxu olwn twn diergasiwn ginetai me mhnymata ta opoia eqoun thn exhs morfh
[sizeof(char)*10 :headersize][ header ][ mhnyma ]
h kefalida arqika perieqei duo qarakthres gia na deixei to tupo tou aithmatos ka mporei na
perieqei plhrofories opws to megejos tou mhnumatos ton tupo tou aithmatoston arijmo tou
mhnumatos an prokeitai gia apostolh dedwmenwn pou den mporoun na graftoun mono me mia
fora sto fifo ,to pid mias boardpost gia na xeqwrizontai ta mhnymata apo ton board_server
se periptwsh pou qreiazontai polles fores read

board:
To programma board analambanei ton elegqo leitourgias tou board_server se periptwshh
pou den treqei tote kanei fork() kai exec to programma board_server.
Meta kanei sleep(1) etsi wste na eqei exasfalistei h dhmiourgia twn pipes apo ton server
kai anoigei thn write pleura tou fifo self_r, anoigei thn read pleura tou fifo self_w
Stelnei mhnyma ston server me oti treqei diergasia board kai o server anoigei thn write
tou fifo self_w. Meta afou eqoun ginei oi katalhlles arqikopoihseis to programma board
mpanei se epanalhyh opou perimenei na diabasei tis antistoiqes entoles.An h entolh einai h
exit Stelnei mhnuma ston server oti kleinei to programma board kai o server kleinei thn write
pleura tou fifo self_w

board_server:
Analambanei thn dhmiourgia twn fifo kai enos arqeio me onoma _spid to opoio perieqei to pid
tou server kai qrhsimopoieitai gia ton elegxo ths leitourgias tou. Ta self_r kai ta others_r
fifo ta anoigei se RDWR mode kajws qrhsimopoieitai gia thn axiopisth leitourgikothta ths select
sto sugkekrimeno programma. Sugkekrimena otan h write pleura enos fifo einai kleistei h eqei
qleisei h select anagnwrizei to fifo ws ready opws leei kai sto man ths select "Three  independent
sets of file descriptors are watched.  Those listed  in readfds will be watched to see if characters
become  available for  reading  (more  precisely, to see if a read will not block; in particular,
a file descriptor is also ready on end-of-file)" etsi gia na uparqei panta mia anoiqth write pleura
anoigetai s auto to mode. Meta apo auta mpainei se ena loop kai perimenei na xemplokarei h select
etsi wste na diabasei mhnymata apo ta fifos gia thn litourgikothta twn getmessages list send se
periptwsh pou to mhnuma einai megalutero apo to epitrepto (512) ginontai pollapla write me antistoiqes
kefalides gia thn apofugh lajwn logo ths eleipshs sugqronismou.

boardpost:
xekinaei kanei elegqo leitourgias tou server an treqei tote sunexizei thn ektelesh alliws kleinei me
lajous. Sthn periptwsh pou douleuei anoigei thn write pleura kai stelnei mhnyma ston server oti ena boardpost
treqei o server lambanei to mhnuma kai auxanei ton arijmo twn boardpost an autos htan 0 anogei thn write pleura
tou fifo others_w alliws einai hdh anoiqth opote den qreiazetai kapoia drash. Meta mpainei se mia epanalhyh opou
perimenei entoles apo ton qrhsth. An h entolh einai h exit tote stelnei mhnuma ston server oti kleinei ena
boardpost opote kai o server meiwnei ton arijmo twn boardpost an ginei 0 tote kleinei thn others_w pleura.

PARADOQES:
-to programma board prepei na kleijei me path to opoio teleiwnei se /
-epipleon an to path einai lajos epelexa na mhn ftiaqnei tous fakelous
 pou apaitountai mias kai einai eujhnh tou qrhsth na dwsei swsto
 path kai oqi tou programmatos na dhmiourghsei lajos fakelous
 p.q. dinei ./board /home/manos/documents/board kai einai lajos
      enw to swsto einai ./board /home/manos/Documents/board
 kati tetoio dhmiourgei askopa fakelo logw enos mikrou lajous.
 wstoso an auto htan aparaithto mporei na ginei eukola me strtok gia
 ta onomata kai klhseis mkdir
-Upojetw oti ta mhnumta pou stelnontai me write <id> <mhnuma> mporoun na staloun me ena
 write wstoso o server uposthrizei lhyh mhnumatwn megaluterou megejous.!!!! PROSOQH!!!!!!
 arqeia kai entoles opws getmessages k list mporoun na ginoun me pollapla write kai
 upsthrizontai

bulletin-boards's People

Contributors

manospits avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.