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,438e216ec7b71466 X-Google-Attributes: gid103376,public From: "Vladimir Olensky" Subject: Re: Trouble getting Winsock binding to work. Date: 2000/02/16 Message-ID: #1/1 X-Deja-AN: 586602676 References: <38AAE07D.8643B1E3@quadruscorp.aunti.spam.com> Organization: Posted via Supernews, http://www.supernews.com X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Newsgroups: comp.lang.ada X-Complaints-To: newsabuse@supernews.com Date: 2000-02-16T00:00:00+00:00 List-Id: One should call WSAStartup before making any attempt to use sockets under Win32. Regards, Vladimir Olensky Marin D. Condic wrote in message <38AAE07D.8643B1E3@quadruscorp.aunti.spam.com>... >Maybe someone here can help me spot the error.... >The problem is that the >function consistently returns INVALID_SOCKET and I can't figure if I >have something wrong with the parameters or am missing something >obvious. > >The code below illusrates the problem. If you can spot my error, I'd >appreciate the help. (BTW: If you reply to this message, please remove >all the anti-spam chaff in my return address.) > >MDC > > >with Ada.Text_IO ; >with Win32.Winsock ; > >procedure Test_It is > -- > pragma Linker_Options ("-lwsock32") ; > -- > Loc_Socket : Win32.Winsock.Socket ; > -- > use type Win32.Winsock.Socket ; > -- >begin > Ada.Text_IO.Put_Line ("Starting Socket Function") ; > Loc_Socket := Win32.Winsock.socket_func ( > af => Win32.Winsock.PF_INET, > c_type => Win32.Winsock.SOCK_STREAM, > protocol => 0) ; > -- > if (Loc_Socket = Win32.Winsock.INVALID_SOCKET) then > Ada.Text_IO.Put_Line ("Invalid Socket Returned.") ; > else > Ada.Text_IO.Put_Line ("Valid Socket Returned.") ; > end if ; > -- > Ada.Text_IO.Put_Line ("Socket Call Complete.") ; >end Test_It ; > >-- >============================================================= >Marin David Condic - Quadrus Corporation - 1.800.555.3393 >1015-116 Atlantic Boulevard, Atlantic Beach, FL 32233 >http://www.quadruscorp.com/ >m c o n d i c @ q u a d r u s c o r p . c o m > >***PLEASE REMOVE THE "-NOSPAM" AND AUNTI.SPAM*** >*** PART OF MY RETURN ADDRESS *** > >Visit my web site at: http://www.mcondic.com/ > >"Because that's where they keep the money." > -- Willie Sutton when asked why he robbed banks. >=============================================================