What functions connect( )& accept( ) call in socket interfac, Computer Engineering

Assignment Help:

What functions connect( ) and accept ( ) call in Socket interfacing?

connect() system call:

Clients use procedures connect to initiate connection with an exact server. The form is connect ( socket , saddress, saaddresslen)

Argument socket is the descriptor of a socket upon the client's computer to utilize for the connection. Argument sockaddress is a sockaddr structure which specifies protocol port number and the server's address. Argument saaddresslen identifies the length of the server's address measured in octets.

The client doesn't have to bind a local address before call ing connect( ).

connect( ) inside can call bind() to connect to a local address if not completed previous.

accept() system call:

After a connection oriented server executes the listen( ) system call , a real connect ion from some client process is waited for throgh having the server execute the accept () system call. Therefore the form is:

accept (sockfd, sockaddr * peer, int* addrlen)

Such system call returns up to three values: an integer return code which is either an error indication or a newly socket descriptor, the address of the client process (i.e. peer) and the size of such address(i.e. addrlen).

Accept automatically creates a new socket descriptor, supposing the server is a concurrent server.

While a connection request is obtained, the process forks, along with the child process servicing the connection and also the parent process waits for the other connection request.


Related Discussions:- What functions connect( )& accept( ) call in socket interfac

Cheques vs credit cards, Cheques vs Credit Cards       E-cheques:  E-ch...

Cheques vs Credit Cards       E-cheques:  E-cheques are used for business dealing in e-commerce.  Transactions of these cheques take place on Internet. In this system the elect

The current image in gimp, How do we merge an image from a file to the curr...

How do we merge an image from a file to the current image in GIMP? Ans) Use "File then Open as Layers" menu command or just take the file to a window and drop it there. The file w

Logic-based expert systems - artificial intelligence, Logic-based Expert Sy...

Logic-based Expert Systems - Artificial intelligence: Expert systems are agents which are programmed to make decisions about real world situations. They are put together by uti

Difference between reply-to and return-path , What is the difference betwee...

What is the difference between Reply-to and Return-path in the headers of a mail function? Ans) Reply-to: Reply-to is where to deliver the respond of the mail. Return-pat

Input - output devices using device controller, Q. Input - output Devices u...

Q. Input - output Devices using Device Controller? A device controller needs not to necessarily control a single device. It can typically control multiple I/O devices. It come

Risks by financial service provider perspective, What are the risks by fina...

What are the risks by financial service provider's perspective in Electronic Payment Systems? Through the financial service provider's perspective: • Stolen service or c

Illustrate simple ALU organisation, Q. Illustrate Simple ALU Organisation? ...

Q. Illustrate Simple ALU Organisation? An ALU comprises circuits which perform data processing micro-operations. Though how are these ALU circuits used in conjunction of other

Example of weight training calculations, Example of Weight training calcula...

Example of Weight training calculations: Through having calculated all the error values associated with such each unit like hidden and output then we can now transfer this inf

What is input - output instructions, Q. What is Input - Output Instructions...

Q. What is Input - Output Instructions? An I/O instruction is stored in memory of computer and is fetched as well as executed by processor producing an I/O-related command for

Characteristics of extreme unencoded micro-instructions, Q. Characteristics...

Q. Characteristics of extreme unencoded micro-instructions? 1. Two sources can be attached by respective control signals to a single destination; though only one of these sourc

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd