gnat sockets problem

From: wave (mutilation_at_bonbon.net)
Date: 05/30/04


Date: 29 May 2004 17:08:05 -0700

Hi, I apologise that yet again I ask this newsgroup another question,
but I've exhausted google and all the resources I could find on this
subject!

I'm having a problem, basically I'm wanting to write an ada program to
return a raw quake3 server string. If any of you know how this works,
it's over udp and you're sending the server a basic keyword command
and then it responds timely to your request.

Here's the problem; in my code the server is only giving me back 4
characters of the response the server should give, and I can't figure
out why. I wondered if any of you lovely people could shed some light
on this issue if you have any experience in this area.

Here is my code below:

with Gnat.Sockets; use Gnat.Sockets;
with Ada.Text_Io; use Ada.Text_Io;

procedure meh is
   Socket : Socket_Type;
   Server : Sock_Addr_Type;
   Channel : Stream_Access;
begin

   Initialize;
   Create_Socket (Socket, Family_Inet, Socket_Datagram);

-- Functioning ip address of a server I'm trying to query
   Server := (
      Addr => Addresses (Get_Host_By_Name ("216.12.23.248"), 1),
      Port => 27960,
      Family => Family_Inet
      );

 Bind_Socket (Socket, Server);

 Connect_Socket (Socket, Server);
 Channel := Stream (Socket);

-- tried Character'Val(255) instead of ˙ too!
 String'Output (Channel,"˙˙˙˙getstatus");

    loop
      declare
  Message : String := String'Input (Channel);
      begin
         Put (Message);
      end;
   end loop;

 Close_Socket (Socket);
end meh;

It all goes so well up until a point, but instead of the server
responding with "˙˙˙˙statusResponse.\game_version\sof2mp-1.02\sv_keywords\SOF2FULL.\sv_pure\1\......"
I'm only just getting the ˙˙˙˙.
Is there some limit to the amount of data ada can send back or
something?

There are some quake3 protocol specs here:
http://www.game-tracker.com/gameproto/enemyterritory.htm (et is just a
mod for q3, same concept) that should show how the server should
behave in this situation.

As always, I'm really helpful for any insight you can give me.

Cheers guys.



Relevant Pages

  • Re: How to terminate a socket in CLOSE_WAIT state
    ... FTP Server fixed for certain FTP clients who use both passive ... This was causing a PASSIVE opened socket to be left ... but instead expect the "half close" from the receiver. ... this sends a TCP/IP FIN packet to the ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Socket switch delay
    ... both at the client and at the server (and why ... would you set the send buffer size to zero on a non-overlapped ... One glaring error is your client does ... So when you use a single socket, ...
    (microsoft.public.win32.programmer.networks)
  • Re: Applet Hangs when submitting data to servlet
    ... to put a time limit on my socket connections and socket reads. ... public void setTimeoutthrows UnknownHostException, ... on our web server. ... private JButton theSubmitButton_, theClearButton_; ...
    (comp.lang.java.programmer)
  • Re: Problem with writing fast UDP server
    ... UDP packets per second. ... socket and threads. ... I wrote a simple case test: client and server. ... The maximum theoretical limit is 14,880 frames per ...
    (comp.lang.python)
  • Re: Socket Exception
    ... In this case the server most likely rejected your ... connection. ... Each command is a new socket connection that is opened and closed ... /// Required designer variable. ...
    (microsoft.public.win32.programmer.networks)