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

What is fork swap, What is Fork swap? "Fork ()" is a system call to mak...

What is Fork swap? "Fork ()" is a system call to make a child process. When the parent process calls "fork()" system call, the child process is formed and if there is short of

Show the responsibilities of session layer, Q. Show the Responsibilities of...

Q. Show the Responsibilities of session layer? Session layer: Main functions of this layer are to establish, synchronize and maintain the interaction between two communicatio

What is schedulers, What is schedulers?  A process migrates between the...

What is schedulers?  A process migrates between the various scheduling queues throughout its life time. The OS must select processes from these queues in some fashion. This sel

How the characters used in operand data type, Q. How the Characters used in...

Q. How the Characters used in operand data type? A common form of data is character or text strings. Characters are signified in numeric form mostly in ASCII (American Standard

Representation scheme in artificial intelligence, Representation scheme in ...

Representation scheme in artificial intelligence: It is not hard to see why logic has been popular representation scheme in AI: In this way, It is easy to represent knowl

Illustrate about the single inheritance, Illustrate about the single inheri...

Illustrate about the single inheritance During inheritance, superclass feature may by override by a subclass defining that feature with the same name. The overriding features (

Define synchronization latency problem, Q. Define Synchronization Latency P...

Q. Define Synchronization Latency Problem? If two simultaneous processes are executing remote loading then it's not recognized by what time two processes will load as issuing p

Advanced microprocessor, Write a program to mask bits D3D2D1D0 and to set ...

Write a program to mask bits D3D2D1D0 and to set bits D5D4 and to invert bits D7D6 of the AX register.

How the conversation speed of A/D converter is maximum, The conversation sp...

The conversation speed of an analog to digital converter is maximum with which technique? Ans. With parallel comparator AD converter technique the conversation speed of an ana

Explain working of supercomputer, Q. Explain working of Supercomputer? ...

Q. Explain working of Supercomputer? Supercomputers, capable of executing in excess of one billion floating-point operations per second (FLOPS), are very powerful, extremely hi

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