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.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,297123c81a4f80e1,start X-Google-Attributes: gid103376,public From: joshhighley@hotmail.com (Josh Highley) Subject: Socket buffer filling up Date: 1999/11/18 Message-ID: <383403bd.0@silver.truman.edu>#1/1 X-Deja-AN: 550244716 X-Trace: news.more.net 942954962 150.243.160.9 (Thu, 18 Nov 1999 13:56:02 CST) Organization: Truman State University User-Agent: Xnews/2.09.30 NNTP-Posting-Date: Thu, 18 Nov 1999 13:56:02 CST Newsgroups: comp.lang.ada Date: 1999-11-18T00:00:00+00:00 List-Id: I'm using Jerry van Dijk's AdaSockets package. My program performs a loop in which two different connections are opened, then closed. There is then a programmed delay of several minutes before the loop is repeated. My problem is that after running for several hours, the socket buffer fills up and I get errors when trying to connect, and my web browser can't reach any websites. When I terminate my program, my browser then works fine. Here's the main points of my code: WITH Sockets; USE Sockets; -- other withs 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 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; Looking through the sockets package, I noticed "Bind" and "Setsockopt" which has a SO_REUSEADDR option. I've looked at numerous sources on the web, trying to find the exact purpose and use of these but couldn't find any answers. Now that I'm looking at my abbreviated code, I realize that I'm not getting all of the data sent to me on Connection2. This is on purpose since I only need a little piece of information (the number of new messages in my email account) I then close the connection without getting the rest of the data. I've been assuming that I get the data as the server sends it, but I guess the data is stored in the buffer and I 'get' the data from the buffer, which is why the buffer is filling up. Is this correct; did I just answer my own question? I think I got confused on what was going in the buffer. Anyway, I'm still interested in getting more info on the other functions in Sockets, like Bind and Setsockopt, if anyone knows some sources. Thanks, Josh Highley joshhighley@hotmail.com