comp.lang.ada
 help / color / mirror / Atom feed
From: "Chad R. Meiners" <v025@truman.edu>
Subject: Re: Socket buffer filling up
Date: 1999/11/18
Date: 1999-11-18T00:00:00+00:00	[thread overview]
Message-ID: <38342539.0@silver.truman.edu> (raw)
In-Reply-To: 383404ee.0@silver.truman.edu

Josh,

    I believe your problem has to do with the fact you are only shutting
down the socket and not closing it.  You are running out of available
sockets so either you need to reuse the sockets you have, or you need to use
the close_socket api form the Winsock api's to release them so other
programs can allocate sockets.  I have extended Jerry's socket package to
have this functionality.   E-mail me if you would like this package

-Chad R. Meiners

Josh Highley <joshhighley@hotmail.com> wrote in message
news:383404ee.0@silver.truman.edu...
> joshhighley@hotmail.com (Josh Highley) wrote in
> <383403bd.0@silver.truman.edu>:
>
> oops, my code wasn't correct, I forgot to specify the beginning of the
> loop.  Here's the correct code, hopefully:
>
> WITH Sockets;
> USE  Sockets;
> -- other wits and uses
>
> PROCEDURE my_sockets IS
>
>    Connection1 : Socket_Fd;
>    Connection2 : Socket_Fd;
>    Http_Port   : CONSTANT Positive  := 80;
>    Web_Server1 : CONSTANT String    := "www.server-one.com";
>    Web_Server2 : CONSTANT String    := "www.server-two.com";
>
> BEGIN  -- main program
>    LOOP
>       Connection1 := Socket (Af_Inet, Sock_Stream);
>       Put_Line("Connecting. . .");
>       Connect (Connection1, Web_Server1, Http_Port);
>          -- put stuff on socket
>       -- get stuff from socket
>       Shutdown(Connection1);
>
>          -- parse the data received
>
>       Connection2 := Socket (Af_Inet, Sock_Stream);
>       Connect(Connection2, Web_Server2, Http_Port);
>
>       -- put stuff on socket
>       -- get stuff from socket until certain information is found, then...
>       Put_Line("Closing Connection.");
>       Shutdown(Connection2);
>       DELAY Seconds_Wait;  -- I've been delaying 3 minutes
>    END LOOP;
>
> END my_sockets;
>
>
> Thanks,
>
> Josh Highley
> joshhighley@hotmail.com
>
>






  reply	other threads:[~1999-11-18  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-18  0:00 Socket buffer filling up Josh Highley
1999-11-18  0:00 ` Josh Highley
1999-11-18  0:00   ` Chad R. Meiners [this message]
1999-11-19  0:00     ` Laurent Guerby
1999-11-19  0:00       ` tmoran
1999-11-18  0:00   ` David C. Hoos, Sr.
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox