From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: * X-Spam-Status: No, score=1.0 required=5.0 tests=AXB_XMAILER_MIMEOLE_OL_024C2, BAYES_50,MAILING_LIST_MULTI autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d0728b52f51f685e X-Google-Attributes: gid103376,public Path: controlnews3.google.com!news1.google.com!news.glorb.com!fr.ip.ndsoftware.net!proxad.net!usenet-fr.net!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: "Andrew Carroll" Newsgroups: comp.lang.ada Subject: copy constructor for sockets Date: Sat, 22 May 2004 15:18:36 -0600 Organization: Cuivre, Argent, Or Message-ID: NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: melchior.cuivre.fr.eu.org 1085259629 6450 212.85.156.195 (22 May 2004 21:00:29 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Sat, 22 May 2004 21:00:29 +0000 (UTC) To: Return-Path: X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Virus-Scanned: by amavisd-new-20030616-p7 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: controlnews3.google.com comp.lang.ada:781 Date: 2004-05-22T15:18:36-06:00 Okay, I have written a small test server. All it does is Accept() connections and Get_line() and then a final Get(). It is just an experiment but I want the server now to create a task (with a socket as one of it's members) and initialize that socket. There are two types of tasks however and the distinction between which task to create comes from the header information in the get_line() right after the Accept(). If it is a GET header then I would create task type A, if it is a POST then I would create task type B. So, the server must accept the socket and do an initial read to get the header information (GET or POST) to know which type of task to create. Then I want to initialize the socket that is in the task type to be the same as the socket in the server that was just accepted. It would probably need to be a "deep copy" of the socket because the server will need to release the socket and the task will need to keep the socket. By release I mean close() and by keep I mean use for communication. The other option is to use an access yet I think it could be done without it. Doesn't the ":=" operator to a "deep copy"? Andrew