>
> I'm writing a client as well, based off the fedone websocket code. Is
> the protocol you're using here consistent with the fedone protocol?
> That is, if I make a few changes to my code to use HTTP and use
> numbers instead of string keys for the protocol, will my client (more
> or less) be able to talk to your server?
>
> More or less: Yes.

I did not have the time to look at the websockets protocol. So I can only
compare with the binary protocol.
Here is how it works in my HTTP implementation (see the protobuf file
below):

a) You need to send a login message (your JID)  to receive a session ID.
b) The client sends a request message that always contains the session ID,
this way the server recognizes a client across multiple HTTP requests
c) There is a two-sided simplex-stop-and-wait-protocol in place to deal with
broken HTTP connections.
d) The client must ensure that it always has a HTTP long-call pending. This
allows the server to push data to the client.
e) The server will close idle connections. The client must reconnect to tell
the server that it is still alive. Failure to reconnect several times tells
the server that the client is gone and the session willl be disposed.

Here is the protobuf I use for client/server communication:

syntax = "proto2";

import "common.proto";
import "waveclient-rpc.proto";

package webclient;

/**
 * Communication between client and server is always achieved by sending
 * a Request message via HTTP POST and receiving a Response message
 * from the web server. The web server treats each HTTP Post as a long call.
 */
message Request
{
  required string session_id = 1;
  /**
   * The last sequence number received by the client.
   */
  required int64 client_ack = 2;
  /**
   * The sequence number of this client-request.
   * A zero sequence number means that the request does not carry
information itself.
   * In this case it is simply a pull.
   */
  required int64 client_sequence_number = 3;
  optional LoginRequest login = 10;
  optional waveserver.ProtocolOpenRequest open = 11;
  optional waveserver.ProtocolSubmitRequest submit = 12;
}

message Response
{
  optional string error_message = 1;
  required int64 server_ack = 2;
  /**
   * The sequence number of this server response.
   * A zero sequence number means that the response does not carry
information itself.
   * In this case it can be ignored.
   */
  required int64 server_sequence_number = 3;
  optional LoginResponse login = 10;
  optional waveserver.ProtocolWaveletUpdate update = 11;
  optional waveserver.ProtocolSubmitResponse submit = 12;
}

message LoginRequest
{
  required string jid = 1;
}

message LoginResponse
{
  required string session_id = 1;
}


Cheers
torben

-- 
You received this message because you are subscribed to the Google Groups "Wave 
Protocol" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/wave-protocol?hl=en.

Reply via email to