copy constructor for sockets

From: Andrew Carroll (andrew_at_carroll-tech.net)
Date: 05/22/04


Date: Sat, 22 May 2004 15:18:36 -0600
To: <comp.lang.ada@ada-france.org>

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



Relevant Pages

  • Re: How to terminate a socket in CLOSE_WAIT state
    ... FTP Server fixed for certain FTP clients who use both passive ... This was causing a PASSIVE opened socket to be left ... but instead expect the "half close" from the receiver. ... this sends a TCP/IP FIN packet to the ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Socket switch delay
    ... both at the client and at the server (and why ... would you set the send buffer size to zero on a non-overlapped ... One glaring error is your client does ... So when you use a single socket, ...
    (microsoft.public.win32.programmer.networks)
  • Re: Applet Hangs when submitting data to servlet
    ... to put a time limit on my socket connections and socket reads. ... public void setTimeoutthrows UnknownHostException, ... on our web server. ... private JButton theSubmitButton_, theClearButton_; ...
    (comp.lang.java.programmer)
  • Re: Problem with writing fast UDP server
    ... UDP packets per second. ... socket and threads. ... I wrote a simple case test: client and server. ... The maximum theoretical limit is 14,880 frames per ...
    (comp.lang.python)
  • Re: Socket Exception
    ... In this case the server most likely rejected your ... connection. ... Each command is a new socket connection that is opened and closed ... /// Required designer variable. ...
    (microsoft.public.win32.programmer.networks)