SlideShare a Scribd company logo
1 of 2
################################################################################
################################################################################
################################################################################
####################
Note: void pointer came with C89(iso standard)
Socket is an end to end communication technique. Socket is a tuple of Ip
address and port number.
Server can be Iterative or Concurrent server.
Iterative server :
The server which can serves the single client's request at a
time.
Concurrent Server:
The server which can serves the multiple client's request at
a time.
Cocurrency can be obtained by either:
#multiple process--parent-child(fork() call)
#multi-threaded process
#I/o Multiplexing techniques(Select method)
Note: When connection is to be established kernel maintains two queues:
1) Incomplete connection queue
2) Complete connection queue
bind() call associates the particular Ip address and port number to it.
listen calls decides how many clients are present in Incomplete and
complete connection queue.
Accept() call is blocked only when complete connection queue is empty.
Connection Establishment is three way Handshaking process which is
initiated by client with "connect()" system call.
################################################################################
######################################
Note: FIN message is sent when either socket is closed for write end or
both. It is also sent when close(sd) is called.
Shutdown call only closes the socket for either read or write or both
operation.
It doesn't decreases the reference count.
shutdown(int sd,int option);
option:
SHUT_RD , SHUT_WR , SHUT_RDWR
close(sd) ---> decreases the reference count by 1 and releases resources only
when reference count is 0.
Possibility of Zombie(Defunct ) process in Parent-child(Concurrent server)===>
In case of parent-child concurrent server, in order to maintain concurrency
parent can't wait for collecting exit status of
child process.So it is always possible child completes it's processing and
exits before parent process completes execution.
This causes zombie or defunt process creation. To get rid of zombie process
creation , we can use signal which led to (user-defined ) function is called on
signal SIGCHLD is recieved .This function takes care of obtaining status of
child process. waitpid() version of system called is used with polling
mechanism.
Note: Zombie process are in termination state so it doesn't takes part in CPU
scheduling but it's record on PCB is still there.
Threading concepts:
Thread can be joinable thread or detached thread.
Threads are by default joinable.
Detached thread :
AS soon as detached thread exits, resources allocated to thread are freed
immediately.
Joinable thread:
joinable thread blocks one thread till exit or completion of other thread.
Non-blocking(with polling) is bit faster than blocking techniqueue.
Non-blocking(with polling) absorbs more cpu cycle as it is running state.
Blocking process goes to sleep state, so doesn't takes cpu cycle.

More Related Content

What's hot

文学生态视野中的江南文化与“重写文学史''运动
文学生态视野中的江南文化与“重写文学史''运动文学生态视野中的江南文化与“重写文学史''运动
文学生态视野中的江南文化与“重写文学史''运动
sugeladi
 
Alquiler TT FGW Mexico
Alquiler TT FGW MexicoAlquiler TT FGW Mexico
Alquiler TT FGW Mexico
rbyerlee
 
Jing Liang_EmergencyMap
Jing Liang_EmergencyMapJing Liang_EmergencyMap
Jing Liang_EmergencyMap
Jing Liang
 

What's hot (19)

文学生态视野中的江南文化与“重写文学史''运动
文学生态视野中的江南文化与“重写文学史''运动文学生态视野中的江南文化与“重写文学史''运动
文学生态视野中的江南文化与“重写文学史''运动
 
Ud 3 metabolismo de proteínas
Ud 3 metabolismo de proteínas Ud 3 metabolismo de proteínas
Ud 3 metabolismo de proteínas
 
Alquiler TT FGW Mexico
Alquiler TT FGW MexicoAlquiler TT FGW Mexico
Alquiler TT FGW Mexico
 
~$Ch1
~$Ch1~$Ch1
~$Ch1
 
Solutions manual8085gaonkar
Solutions manual8085gaonkarSolutions manual8085gaonkar
Solutions manual8085gaonkar
 
The Dawn of Coworking
The Dawn of CoworkingThe Dawn of Coworking
The Dawn of Coworking
 
Why use Ruby and Rails?
Why use Ruby and Rails?Why use Ruby and Rails?
Why use Ruby and Rails?
 
Final layout designs
Final layout designsFinal layout designs
Final layout designs
 
Power point
Power pointPower point
Power point
 
Are we really that old
Are we really that oldAre we really that old
Are we really that old
 
King and queen symbolic .
King and queen symbolic .King and queen symbolic .
King and queen symbolic .
 
My convulsion ( i.e. fit ) problem @bbay child related some presentation po...
  My convulsion ( i.e. fit ) problem @bbay child related some presentation po...  My convulsion ( i.e. fit ) problem @bbay child related some presentation po...
My convulsion ( i.e. fit ) problem @bbay child related some presentation po...
 
Jing Liang_EmergencyMap
Jing Liang_EmergencyMapJing Liang_EmergencyMap
Jing Liang_EmergencyMap
 
Prueva 2
Prueva 2Prueva 2
Prueva 2
 
Ruby Cold Cuts Part 1
Ruby Cold Cuts Part 1Ruby Cold Cuts Part 1
Ruby Cold Cuts Part 1
 
`~ The latest was my granee parents memories and that were tele-link netwo...
`~ The latest was  my granee parents  memories and that were tele-link  netwo...`~ The latest was  my granee parents  memories and that were tele-link  netwo...
`~ The latest was my granee parents memories and that were tele-link netwo...
 
Ancient pagan and modern christian symbolism
Ancient pagan and modern christian symbolismAncient pagan and modern christian symbolism
Ancient pagan and modern christian symbolism
 
Nuclear plant fumes related – hollywood film hunger games cathching fire...
Nuclear  plant fumes related – hollywood film     hunger games cathching fire...Nuclear  plant fumes related – hollywood film     hunger games cathching fire...
Nuclear plant fumes related – hollywood film hunger games cathching fire...
 
Speci fic @ancient greek symbology and astronomy.
Speci fic @ancient greek symbology and astronomy.Speci fic @ancient greek symbology and astronomy.
Speci fic @ancient greek symbology and astronomy.
 

Similar to Socket related concepts

Driver whiz serial_key_download
Driver whiz serial_key_downloadDriver whiz serial_key_download
Driver whiz serial_key_download
DANIELFIVE
 
Driver whiz serial_key_download
Driver whiz serial_key_downloadDriver whiz serial_key_download
Driver whiz serial_key_download
DANIELFIVE
 
python_assignmentHanoi (1).py################################.docx
python_assignmentHanoi (1).py################################.docxpython_assignmentHanoi (1).py################################.docx
python_assignmentHanoi (1).py################################.docx
amrit47
 
211629 convert into plain text men and sex a portrait of their experience (1)
211629 convert into plain text men and sex   a portrait of their experience (1)211629 convert into plain text men and sex   a portrait of their experience (1)
211629 convert into plain text men and sex a portrait of their experience (1)
maryjoyallives
 

Similar to Socket related concepts (20)

GIAB Sep2016 Lightning Effective Depth Metric yves konigshofer_sera_care
GIAB Sep2016 Lightning Effective Depth Metric yves konigshofer_sera_careGIAB Sep2016 Lightning Effective Depth Metric yves konigshofer_sera_care
GIAB Sep2016 Lightning Effective Depth Metric yves konigshofer_sera_care
 
ARTES 20 IAP Success Story - Vecmap
ARTES 20 IAP Success Story - VecmapARTES 20 IAP Success Story - Vecmap
ARTES 20 IAP Success Story - Vecmap
 
Various methods of field data collection and spatial analysis
Various methods of field data collection and spatial analysisVarious methods of field data collection and spatial analysis
Various methods of field data collection and spatial analysis
 
Lista inscritos cera 2015
Lista inscritos cera 2015Lista inscritos cera 2015
Lista inscritos cera 2015
 
Gg
GgGg
Gg
 
Gg
GgGg
Gg
 
Thibaut Sailly - Behind the scene at captain train - UX Lausanne 2016
Thibaut Sailly - Behind the scene at captain train - UX Lausanne 2016Thibaut Sailly - Behind the scene at captain train - UX Lausanne 2016
Thibaut Sailly - Behind the scene at captain train - UX Lausanne 2016
 
Driver whiz serial_key_download
Driver whiz serial_key_downloadDriver whiz serial_key_download
Driver whiz serial_key_download
 
Driver whiz serial_key_download
Driver whiz serial_key_downloadDriver whiz serial_key_download
Driver whiz serial_key_download
 
python_assignmentHanoi (1).py################################.docx
python_assignmentHanoi (1).py################################.docxpython_assignmentHanoi (1).py################################.docx
python_assignmentHanoi (1).py################################.docx
 
Frame tech onsite_seo
Frame tech onsite_seoFrame tech onsite_seo
Frame tech onsite_seo
 
Informe
InformeInforme
Informe
 
211629 convert into plain text men and sex a portrait of their experience (1)
211629 convert into plain text men and sex   a portrait of their experience (1)211629 convert into plain text men and sex   a portrait of their experience (1)
211629 convert into plain text men and sex a portrait of their experience (1)
 
Volume d
Volume dVolume d
Volume d
 
Viva
VivaViva
Viva
 
Música
MúsicaMúsica
Música
 
Kbs
KbsKbs
Kbs
 
Install
InstallInstall
Install
 
Install
InstallInstall
Install
 
Install
InstallInstall
Install
 

Recently uploaded

Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
mphochane1998
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
chumtiyababu
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
AldoGarca30
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
Kamal Acharya
 

Recently uploaded (20)

S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and properties
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Wadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxWadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptx
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 

Socket related concepts

  • 1. ################################################################################ ################################################################################ ################################################################################ #################### Note: void pointer came with C89(iso standard) Socket is an end to end communication technique. Socket is a tuple of Ip address and port number. Server can be Iterative or Concurrent server. Iterative server : The server which can serves the single client's request at a time. Concurrent Server: The server which can serves the multiple client's request at a time. Cocurrency can be obtained by either: #multiple process--parent-child(fork() call) #multi-threaded process #I/o Multiplexing techniques(Select method) Note: When connection is to be established kernel maintains two queues: 1) Incomplete connection queue 2) Complete connection queue bind() call associates the particular Ip address and port number to it. listen calls decides how many clients are present in Incomplete and complete connection queue. Accept() call is blocked only when complete connection queue is empty. Connection Establishment is three way Handshaking process which is initiated by client with "connect()" system call. ################################################################################ ###################################### Note: FIN message is sent when either socket is closed for write end or both. It is also sent when close(sd) is called. Shutdown call only closes the socket for either read or write or both operation. It doesn't decreases the reference count. shutdown(int sd,int option); option: SHUT_RD , SHUT_WR , SHUT_RDWR close(sd) ---> decreases the reference count by 1 and releases resources only when reference count is 0. Possibility of Zombie(Defunct ) process in Parent-child(Concurrent server)===> In case of parent-child concurrent server, in order to maintain concurrency parent can't wait for collecting exit status of child process.So it is always possible child completes it's processing and exits before parent process completes execution. This causes zombie or defunt process creation. To get rid of zombie process creation , we can use signal which led to (user-defined ) function is called on signal SIGCHLD is recieved .This function takes care of obtaining status of child process. waitpid() version of system called is used with polling mechanism.
  • 2. Note: Zombie process are in termination state so it doesn't takes part in CPU scheduling but it's record on PCB is still there. Threading concepts: Thread can be joinable thread or detached thread. Threads are by default joinable. Detached thread : AS soon as detached thread exits, resources allocated to thread are freed immediately. Joinable thread: joinable thread blocks one thread till exit or completion of other thread. Non-blocking(with polling) is bit faster than blocking techniqueue. Non-blocking(with polling) absorbs more cpu cycle as it is running state. Blocking process goes to sleep state, so doesn't takes cpu cycle.