From: "Vladimir Olensky" <vladimir_olensky@yahoo.com>
Subject: Re: Trouble getting Winsock binding to work.
Date: 2000/02/16
Date: 2000-02-16T00:00:00+00:00 [thread overview]
Message-ID: <saloud962pd126@corp.supernews.com> (raw)
In-Reply-To: 38AAE07D.8643B1E3@quadruscorp.aunti.spam.com
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.
>=============================================================
next prev parent reply other threads:[~2000-02-16 0:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-02-16 0:00 Trouble getting Winsock binding to work Marin D. Condic
2000-02-16 0:00 ` Vladimir Olensky [this message]
2000-02-16 0:00 ` Marin D. Condic
2000-02-16 0:00 ` Pascal Obry
2000-02-16 0:00 ` Marin D. Condic
2000-02-17 0:00 ` Pascal Obry
2000-02-17 0:00 ` Gisle S�lensminde
2000-02-17 0:00 ` Pascal Obry
2000-02-17 0:00 ` Vladimir Olensky
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox