comp.lang.ada
 help / color / mirror / Atom feed
* GNAT.SOCKETS.SOCKET_ERROR: [0] Error
@ 2002-10-26  7:17 ulysses
  2002-10-26 10:51 ` David C. Hoos, Sr.
  2002-10-26 12:37 ` Simon Wright
  0 siblings, 2 replies; 4+ messages in thread
From: ulysses @ 2002-10-26  7:17 UTC (permalink / raw)


Hi ,

    Can anyone help me with this problem.
    Ok here's mine code snippet:

       Create_Socket (Socket, Family_Inet,
                  -- OK
       Remote_Addr.Addr :=
Get_Host_By_Name("localhost"));           -- OK
       Remote_Addr.Port :=
       -- OK
       Ada.Text_IO.Put_line("Remote Addr:" & Image(Remote_Addr));
       Channel := Stream(Socket,
              -- NOT OK, give GNAT.SOCKET_ERROR:[0] Error
       Ada.Text_IO.Put_line("222");
       String'Output(Channel, "Hello World");

    I had done a lot of findings and even dig into g-sockets.ads & .adb, but
I just couldn't FIGURE out what's the problem ... :_(.
    Izzit my Address got problem, that cause Stream() function not able to
return me a Stream_Access type ?

    Thanks for any advice....





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: GNAT.SOCKETS.SOCKET_ERROR: [0] Error
  2002-10-26  7:17 GNAT.SOCKETS.SOCKET_ERROR: [0] Error ulysses
@ 2002-10-26 10:51 ` David C. Hoos, Sr.
  2002-10-26 12:37 ` Simon Wright
  1 sibling, 0 replies; 4+ messages in thread
From: David C. Hoos, Sr. @ 2002-10-26 10:51 UTC (permalink / raw)


You need to do these things to get help, viz.:

  1. State which platform and version you're using --
     e.g., RedHat Linux 7.2, Windows XP Professional, etc.
  2. State the version of GNAT you're using, and from
     whence it came -- e.g., ftp.cs.nyu.edu/pub/gnat/3.14p,
     version that came with Linux distribution, etc.
  3. Provide the complete sequence of code that produces
     the problem.
  4. State what you're trying to do -- e.g., create a TCP
     server, connect as a client to a TCP server, etc.

You didn't show any Bind, Connect, or Accept calls in
your code "snippet," nor did you tell us what you're
trying to do, so there's insufficient information for
anyone to give you an answer.

----- Original Message ----- 
From: "ulysses" <ulysses_w@hotmail.com>
Newsgroups: comp.lang.ada
To: <comp.lang.ada@ada.eu.org>
Sent: October 26, 2002 2:17 AM
Subject: GNAT.SOCKETS.SOCKET_ERROR: [0] Error


> Hi ,
> 
>     Can anyone help me with this problem.
>     Ok here's mine code snippet:
> 
>        Create_Socket (Socket, Family_Inet,
>                   -- OK
>        Remote_Addr.Addr :=
> Get_Host_By_Name("localhost"));           -- OK
>        Remote_Addr.Port :=
>        -- OK
>        Ada.Text_IO.Put_line("Remote Addr:" & Image(Remote_Addr));
>        Channel := Stream(Socket,
>               -- NOT OK, give GNAT.SOCKET_ERROR:[0] Error
>        Ada.Text_IO.Put_line("222");
>        String'Output(Channel, "Hello World");
> 
>     I had done a lot of findings and even dig into g-sockets.ads & .adb, but
> I just couldn't FIGURE out what's the problem ... :_(.
>     Izzit my Address got problem, that cause Stream() function not able to
> return me a Stream_Access type ?
> 
>     Thanks for any advice....
> 
> 
> _______________________________________________
> comp.lang.ada mailing list
> comp.lang.ada@ada.eu.org
> http://ada.eu.org/mailman/listinfo/comp.lang.ada
> 
> 




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: GNAT.SOCKETS.SOCKET_ERROR: [0] Error
  2002-10-26  7:17 GNAT.SOCKETS.SOCKET_ERROR: [0] Error ulysses
  2002-10-26 10:51 ` David C. Hoos, Sr.
@ 2002-10-26 12:37 ` Simon Wright
  2002-11-03  7:13   ` ulysses
  1 sibling, 1 reply; 4+ messages in thread
From: Simon Wright @ 2002-10-26 12:37 UTC (permalink / raw)


"ulysses" <ulysses_w@hotmail.com> writes:

Did you remember to call GNAT.Sockets.Initialize? I seem to remember
that code worked on Linux without this and then failed on Windows.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: GNAT.SOCKETS.SOCKET_ERROR: [0] Error
  2002-10-26 12:37 ` Simon Wright
@ 2002-11-03  7:13   ` ulysses
  0 siblings, 0 replies; 4+ messages in thread
From: ulysses @ 2002-11-03  7:13 UTC (permalink / raw)


yes, I did.


"Simon Wright" <simon@pushface.org> wrote in message
news:x7vvg3p8jg4.fsf@pushface.org...
> "ulysses" <ulysses_w@hotmail.com> writes:
>
> Did you remember to call GNAT.Sockets.Initialize? I seem to remember
> that code worked on Linux without this and then failed on Windows.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-11-03  7:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-26  7:17 GNAT.SOCKETS.SOCKET_ERROR: [0] Error ulysses
2002-10-26 10:51 ` David C. Hoos, Sr.
2002-10-26 12:37 ` Simon Wright
2002-11-03  7:13   ` ulysses

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