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 the task of the pass 2 in a two-pass assembler, In a two-pass assem...

In a two-pass assembler, the task of the Pass II is to? Ans. The task of the Pass II is to synthesize the target program in a two-pass assembler.

Explain the process of skolemization., Problem 1. Explain briefly the p...

Problem 1. Explain briefly the process of matching production rules against working memory 2. What are the different kinds of knowledge that need to be represented in AI? Ex

Illustrate high performance fortran, In 1993 High Performance FORTRAN Forum...

In 1993 High Performance FORTRAN Forum which is a group of academicians and many leading software and hardware vendors in field of parallel processing established an informal langu

Give the example of first come first served scheduling, Consider  the  foll...

Consider  the  following set of jobs with  their  arrival  times,  execution  time  (in minutes), and deadlines. Job Ids Ar r ival Time E

What is collection objects in vb, Likewise to arrays but is preferred over ...

Likewise to arrays but is preferred over an array due to of the following reasons. 1. A collection objects uses less Memory than an array. 2. It gives methods to add and dele

Determine frequency of a dtmf phone, In a DTMF phone a dialling of 8 genera...

In a DTMF phone a dialling of 8 generates (A) 1336 Hz- 770 Hz                      (B)  1209 Hz - 1477 Hz (C)  1209 Hz- 941 Hz                     (D)  1336 Hz-852 Hz

Functions of an operating system, a) In multitasking Operating Systems, th...

a) In multitasking Operating Systems, there are two types of multitasking such as the "Preemptive Multitasking" and the "Cooperative Multitasking". Describe the two mentioned mult

What is processor time of a program, What is processor time of a program? ...

What is processor time of a program? The periods during which the processor is active is known as processor time of a program it depends on the hardware included in the executi

Principles of contract law, Andrew, a 17 zear old university student decide...

Andrew, a 17 zear old university student decided to hold a post exams party for his friends. Andrew asked Kath, a family friend and the owner of 'Kath's Katerers' to supply food

Maximum depth to crawl, Goals of this assignment: understanding networking ...

Goals of this assignment: understanding networking and client server systems. In this assignment, you will write a simple http web server that handles conjunctive search queries (l

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