My system seems to require the prepended length. Without it, my read will
just timeout, as if the server is waiting for more data. When the length is
included, then my read command just returns -1. This suggests that the
server is dropping the connection.
Paul Rony
Merchantware
-----Original Message-----
From: Scott Meeuwsen [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 02, 2001 7:55 AM
To: [EMAIL PROTECTED]
Cc: Paul Rony
Subject: RE: Writing Your Own Client
I tested part of the handshake WITHOUT the prepended length last night (just
the Content-Length) using a combination of telnet and notepad. First, I
sent the CHECK VERSION, then I sent the AUTHENTICATE USER message. I
received the challenge! I can now say confidently that the prepending is no
more, at least during the handshake. Hope this helps...
Scott Meeuwsen
API Technologies, LLC
P.S. - Also don't send your password in the password field, send your
username again. I believe this is old and was used before the private key
encryption stuff...
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Paul Rony
> Sent: Tuesday, January 02, 2001 3:20 AM
> To: [EMAIL PROTECTED]
> Subject: RE: Writing Your Own Client
>
>
> I'm now prepending the length but I'm now having trouble authenticating.
> I'm not getting any response back from my authenticate command. Any ideas
> as to why I would not get a response. My user name is merchantware, and I
> am using it for both the username and the password.
>
> Paul Rony
> Merchantware
>
> -----Original Message-----
> From: Charles Daminato [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 29, 2000 12:22 PM
> To: Paul Rony; [EMAIL PROTECTED]
> Subject: RE: Writing Your Own Client
>
>
> You do have to go through the mess - it should be in Big-Endian order...
>
> Charles Daminato
> Product Manager (ccTLDs)
> Tucows Inc. - [EMAIL PROTECTED]
>
> > -----Original Message-----
> > From: Paul Rony [mailto:[EMAIL PROTECTED]]
> > Sent: December 29, 2000 12:23 PM
> > To: 'Charles Daminato '; '[EMAIL PROTECTED] '
> > Subject: RE: Writing Your Own Client
> >
> >
> > I still need more information. Do I send 16-bits (2 bytes) or
> 32-bits (4
> > bytes)?
> >
> > Normally, when sending 16-bits on an Windows/Intel box, I was just write
> > WORD wLength;
> > send ( socket, &wLength, sizeof(wLength) );
> > The send command would write the low byte first, then the high byte.
> >
> > Big-endian suggests that I must perform painful math before sending.
> > WORD wLength;
> > BYTE* pLowByte = (BYTE*) &wLength;
> > BYTE* pHighByte = pLowByte + 1;
> > send ( socket, pHighByte, 1 ) ;
> > send ( socket, pLowByte, 1 ) ;
> >
> > Did I confuse my big-endian and little-endian or do I really have to go
> > through this mess. I would much prefer if Content-Length were the only
> > mechanism used to specify the length of the data.
> >
> > -----Original Message-----
> > From: Charles Daminato
> > To: Paul Rony; [EMAIL PROTECTED]
> > Sent: 12/29/00 10:45 AM
> > Subject: RE: Writing Your Own Client
> >
> > Now, I'm not a programmer but AFAIK...
> >
> > You must pass the packet length to the server in big endian format in
> > the
> > header of the packet ...
> >
> > Charles Daminato
> > Product Manager (ccTLDs)
> > Tucows Inc. - [EMAIL PROTECTED]
> >
> > > -----Original Message-----
> > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> > > Behalf Of Paul Rony
> > > Sent: December 29, 2000 10:18 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: RE: Writing Your Own Client
> > >
> > >
> > > I was thinking the same thing until I tried to send the CHECK VERSION
> > > response without the prepended length. I get no response. My socket
> > just
> > > times out.
> > >
> > > I'm also wondering if there is a required format for the MsgID. I am
> > just
> > > generating a large integer, something like 126225524054375003.
> > > Here is what
> > > I'm sending:
> > >
> > >
> > > Content-Length: 604
> > >
> > > <?xml version='1.0' encoding="UTF-8" standalone="no" ?>
> > > <!DOCTYPE OPS_envelope SYSTEM "ops.dtd">
> > > <OPS_envelope>
> > > <header>
> > > <version>0.9</version>
> > > <msg_id>126225524054375003</msg_id>
> > > <msg_type>standard</msg_type> </header>
> > > <body>
> > > <data_block>
> > > <dt_assoc>
> > > <item key="protocol">XCP</item>
> > > <item key="action">CHECK</item>
> > > <item key="object">VERSION</item>
> > > <item key="attributes">
> > > <dt_assoc>
> > > <item key="sender">OpenSRS
> > > CLIENT</item>
> > > <item
> > key="version">XML:0.1</item>
> > > <item key="state">ready</item>
> > > </dt_assoc>
> > > </item>
> > > </dt_assoc>
> > > </data_block>
> > > </body>
> > > </OPS_envelope>
> > >
> > >
> > > Paul Rony
> > > Merchantware
> > >
> > > -----Original Message-----
> > > From: Scott Meeuwsen [mailto:[EMAIL PROTECTED]]
> > > Sent: Friday, December 29, 2000 9:39 AM
> > > To: [EMAIL PROTECTED]
> > > Cc: Paul Rony
> > > Subject: RE: Writing Your Own Client
> > >
> > >
> > > Paul,
> > >
> > > I am just starting to write my own client so maybe I am not the
> > > best person
> > > to answer this, but I will give you my theory. My best guess is the
> > the
> > > "data prepend" thing is no longer current and should have been removed
> > now
> > > that the "Content-Lenth" header is used. I am basing this on simply
> > > telnetting to port 55000 of horizon.opensrs.net. In the first
> > > response from
> > > the server I see the XML request, the Content-Length, but no binary or
> > hex
> > > data prepended to each line. Someone please correct me if I am wrong.
> > >
> > > Scott Meeuwsen
> > > API Technologies, LLC
> > >
> > > > -----Original Message-----
> > > > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]]On
> > > > Behalf Of Paul Rony
> > > > Sent: Friday, December 29, 2000 3:45 AM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: Writing Your Own Client
> > > >
> > > >
> > > > I'm trying to follow the Appendix C in order to write my own client
> > for
> > > > Windows NT. I'm using C++, so I'm in full control of every
> > > byte sent and
> > > > received. My problem is that the documentation does not clearly
> > > > define all
> > > > bytes in and out.
> > > >
> > > > For example, the Data Exchange section mentions that all data must
> > be
> > > > prepended with the length of the string. Is this length a 16-bit
> > > > or 32-bit
> > > > number? Why is this length needed when the XCP protocol already
> > > > includes a
> > > > Content-Length header on the first line?
> > > >
> > > > Paul Rony
> > > > Merchantware
> > > >
>