Interview Questions Answers.ORG
Interviewer And Interviewee Guide
Interviews
Quizzes
Home
Quizzes
Interviews Coding/Programming Interviews:Active Template Library (ATL)ActiveXApplication DeveloperArtificial intelligenceAssemblyAssociate Software EngineerAWKAWTC ProgrammingC++ ProgrammingCGI PerlCGI ProgrammingCMMICobolCritical ReasoningData Structures TreesDCOM COMDelphiDTDE4XExtensible Stylesheet Language (XSL)FortranFull-Stack DeveloperHaskellHTML DOMILUIPhone DeveloperJasper Reports DeveloperJava DeveloperLisp ProgrammingLotus NotesMicrosoft Foundation Class (MFC)Mobile DeveloperMVC DeveloperNode.jsOOPPascalPerl ProgrammingPHPPHP DeveloperProgrammingProgramming AlgorithmsProgramming ConceptsPythonRubyRuby on RailsRuby on Rails DeveloperSenior Front End DeveloperSenior Software DeveloperSignature ProgramSOASocket ProgrammingSoftware Development EngineerSoftware engineeringSr. PHP ProgrammerStack And QueueSTLSwift DeveloperTCL (Tool Command Language)Team Leader Android DeveloperUMLUnity 2D Games DeveloperUnity 3D DeveloperUnity DeveloperVBA (Visual Basic for Applications)Visual Basic (VB)Visual C++Web DevelopmentWin32APIWindows ProgramingWordPress DevelopmentWSDLXFormsXHTMLXLinkXMLXPathXQueryXSL-FOXSLT
Copyright © 2018. All Rights Reserved
Socket Programming Interview Question:
How Sockets can be used to write client-server applications using a connection-oriented client-server technique?
Submitted by: AdministratorSockets can be used to write client-server applications using a connection-oriented client-server technique. Some characteristics of this technique include:
* The server can handle multiple client requests for connection and service.
* The server responds to any one client's request independently of all other clients.
* A client knows how to establish a connection with the server.
The client-server connection, when established, remains in existence until either the client or the server explicitly breaks it, much like a trouble-free telephone call. The socket used for this connection is called a connection-oriented socket.
The socket type is specified as SOCK_STREAM. As a result, the process receiving a message processes that message by the following rules:
* The data transmitted has no boundaries.
* All bytes in a received message must be read before the next message can be processed.
* Bytes in a received message can be read in a loop program control structure since no data bytes are discarded.
* The server will usually fork() a child process upon establishment of a client connection.
* This child server process is designed to communicate with exactly one client process.
* The child server process performs the requested service for its connected client.
* The child server process terminates when the service request has been completed.
Functions listen() and accept() enable the server to listen for service requests. read() and write() may be used by client and server to send/receive messages; send() and recv() may also be used.
Submitted by: Administrator
* The server can handle multiple client requests for connection and service.
* The server responds to any one client's request independently of all other clients.
* A client knows how to establish a connection with the server.
The client-server connection, when established, remains in existence until either the client or the server explicitly breaks it, much like a trouble-free telephone call. The socket used for this connection is called a connection-oriented socket.
The socket type is specified as SOCK_STREAM. As a result, the process receiving a message processes that message by the following rules:
* The data transmitted has no boundaries.
* All bytes in a received message must be read before the next message can be processed.
* Bytes in a received message can be read in a loop program control structure since no data bytes are discarded.
* The server will usually fork() a child process upon establishment of a client connection.
* This child server process is designed to communicate with exactly one client process.
* The child server process performs the requested service for its connected client.
* The child server process terminates when the service request has been completed.
Functions listen() and accept() enable the server to listen for service requests. read() and write() may be used by client and server to send/receive messages; send() and recv() may also be used.
Submitted by: Administrator
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.