4 Knowledge Base

 

 TelecomTrainning.net > Knowledge Base
 Viewing KB Article
Good Morning, - Please register or - log-in to your account.
Search
Search   Saved Questions   Ask a question
Keywords 
 
Available categories
LTE
100 of Questions in LTE
CCNA Certification
CCNA Sample Q & A (1000 + Q &A)
(Network +) Certification
(Network +) Sample Q & A (1000 + Q &A)
Networking
General/Interview Q& A on Networking
Home Networking
General/Interview Q& A on Networking
VOIP, SIP & Asterisk
Q & A on VOIP,Ethereal, SIP & Asterisk
Telecom Test Equipments
Q & A on Telecom Test Equipment
PSTN / Wireline
General / Interview Q & A on PSTN / Wireline
LTE, Wireless, 3G ,Diameter and HSS
General/Interview Q & A on LTE, Wireless, 3G ,Diameter and HSS
Telecom General
Any Q & A in Telecom in General

Top Questions
Friends, Describe Secure storage and distribution of A-Keys?
How do I monitor SS7 Traffic in spectra2?
what is the difference between E1 signal & Ethernet signal ?
Explain me the difference between a repeater, bridge and router? Relate this to the OSI model.
What is the difference between BRI & PRI ?
Can you tell me about PBGT?
Guys what is the purpose of Umbrella Cell Approach in GSM ?
how can we explain media gateway in MSc?
What is GGSN?
What is the difference between Electrical-tilt and Mechanical-tilt of an antenna?
What is demarc point?
What is BSC?
Can any one explain me how sms flow will work using ss7 network ?( from physical layer to application layer)
Explain SLTA and SLTM messages in MTP3?
why cellphone towers are painted in red and white?
Hi guys what is WAP?
what is EDAp? what is the functions of EDAP?
wat is the difference betweem MSC & GMSC, & MSS & GCS?
what is sdh?
What is a circuit id?

Describe Connection setup listen & accept in socket programming?
shaw 26-October-2007 05:18:59 PM

Comments


#int status = listen(sock, queuelen);
status: 0 if listening, -1 if error
sock: integer, socket descriptor
queuelen: integer, # of active participants that can “wait” for a connection
listen is non-blocking: returns immediately
#int s = accept(sock, &name, &namelen);
s: integer, the new socket desc. (used for data-transfer)
sock: integer, the orig. socket desc. (being listened on)
name: struct sockaddr, address of the active participant
namelen: sizeof(name): value/result parameter
must be set appropriately before call
adjusted by OS upon return
accept is blocking: waits for connection before returning
Posted by waqasahmad


Called by passive participant
1. int status = listen(sock, queuelen);
- status: 0 if listening, -1 if error
- sock: integer, socket descriptor
- queuelen: integer, # of active participants that can “wait” for a connection
- listen is non-blocking: returns immediately
2. int s = accept(sock, &name, &namelen);
- s: integer, the new socket desc. (used for data-transfer)
- sock: integer, the orig. socket desc. (being listened on)
- name: struct sockaddr, address of the active participant
- namelen: sizeof(name): value/result parameter
- must be set appropriately before call
- adjusted by OS upon return
-accept is blocking: waits for connection before returning

Posted by ceeser

Q&A Rating

Q&A Rating
Rate This Question and Answer

Related Questions
How to make Voicemail with Asterisk send email as Attachment once VM is received?
Friends, is Pass through can exist without a signal?
 
What’s the work of IWF in GSM network?


Search questions via popularity
Top viewed questions  Top emailed questions  Most printed questions  Most saved questions
 
Copyright © Telecom Training, All Rights Reserved