I know that the problem is with the header because of the exception that the
Web Server throws, which is:

Http.RequestAdapter.readHeaders(HttpRequestAdapter.java:174)
......

We have gone through the java classes of the tomcat server to see why this
exception was thrown and it seems that when is trying to read the message,
the method readLine returns a -1 which means that reached the end before
reading the maximum number of bytes.

I am sending the piece of code to see if it helps more:

//Char *buffer ="GET ./login?pin=1969&password=darkbold
HTTP/1.0\r\nHost:germinus34\r\n\r\n";
// Find the Lib. Obtaining the Net Library Reference Number
  error = SysLibFind ("Net.lib", &NetLibNum);

 // Open the Lib, make the default connection
  if (NetLibOpen (NetLibNum, &errors))
  {
  FrmCustomAlert(1102,"NetLibOpen","not ", "successful");
  return 1;
 }


 // Open the socket
  timeout = (UInt32)SysTicksPerSecond() * 10;
  SocketRef = NetLibSocketOpen (NetLibNum, netSocketAddrINET,
netSocketTypeStream, netSocketProtoIPTCP, timeout, &errors);

 // Resolve the FIXED ADDRESS
  sockAddrP.family = netSocketAddrINET;
  sockAddrP.port = NetHToNS(8080);
  IPAddr = NetLibAddrAToIN (NetLibNum, "172.19.1.169");
  MemMove ((Char*)&sockAddrP.addr, (Char*)&IPAddr, sizeof(IPAddr));

 // Make the connection
  timeout = (UInt32)SysTicksPerSecond() * 10;
  ConnectResult = NetLibSocketConnect (NetLibNum, SocketRef,
      (NetSocketAddrType*) &sockAddrP, sizeof(sockAddrP) ,timeout,
&errors );

 // Send data
 timeout = (UInt32)SysTicksPerSecond() * 10;
 lenbuffer = StrLen(buffer);

 bytesSent = NetLibSend(NetLibNum, SocketRef, buffer, StrLen(buffer),
netIOFlagOutOfBand,
          (NetSocketAddrType *) &sockAddrP, sizeof(sockAddrP), timeout,
&err);


 bufferIN = MemPtrNew(255);
 timeout = (UInt32)SysTicksPerSecond() * 10;

 bytesReceived = NetLibReceive(NetLibNum, SocketRef, bufferIN, 255,
netIOFlagPeek,
      (NetSocketAddrType *) &sockAddrPMine, &sockAddrPlenMine, timeout,
&err);
 MemPtrFree(bufferIN);

 // Close the Socket
  timeout = (UInt32)SysTicksPerSecond() * 10;
  error = NetLibSocketClose (NetLibNum, SocketRef, timeout, &errors);

 // Close the Connection
  error = NetLibClose(NetLibNum, true);

----- Original Message -----
From: "Steve Mann" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Thursday, June 07, 2001 4:40 PM
Subject: Re: Socket Connections


> >even though the socket
> >connection is established I have problems with the Header of the HTTP
> >message, it seems not to be understood by the server (tomcat server).
>
> How do you know the problems are with the HTTP header? Please be more
> specific about the problem, the symptoms, and what is (or is not)
> happening.
>
> Regards,
> Steve Mann
> --
> -------------------------------------------
> Creative Digital Publishing Inc.
> 1315 Palm Street, San Luis Obispo, CA 93401-3117
> -------------------------------------------
> 805.784.9461              805.784.9462 (fax)
> [EMAIL PROTECTED]       http://www.cdpubs.com
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to