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,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,438e216ec7b71466,start X-Google-Attributes: gid103376,public From: "Marin D. Condic" Subject: Trouble getting Winsock binding to work. Date: 2000/02/16 Message-ID: <38AAE07D.8643B1E3@quadruscorp.aunti.spam.com>#1/1 X-Deja-AN: 586599759 Content-Transfer-Encoding: 7bit Organization: Quadrus Corporation X-Sender: "Marin D. Condic" (Unverified) X-Server-Date: 16 Feb 2000 17:39:18 GMT Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-02-16T17:39:18+00:00 List-Id: Maybe someone here can help me spot the error.... I'm using GNAT 3.12p on Win98 and trying to get the Winsock binding to work successfully. I've got a simple program here which illustrates the problem. Just to illustrate, I've got a simple call to the "Socket" function which parallels examples I've found in "Windows Sockets Network Programming" by Bob Quinn & Dave Shute. I've successfully got the Ada version of the call to compile, link and run. 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. =============================================================