I have few questions, try to find the documents or helps
didn't find much material , I guess this is the best place to get my
questions answered :).
I am writing a server using autobahn (not using pub-sub).
* In a subclass of In WebSocketServerProtocol, self.peer, self.peerstr
Please don't use self.peer or other instance variables directly (they change and should be considered implementation details) .. see below
and request.peer returns IPv4Address(TCP, '127.0.0.1', *56299*), in
this '56299' is a client id (if I am not wrong).
"peer (str) ï¿½ Descriptor of the connecting client (eg IP address/port in case of TCP transports)."
The number you see in that _string_ (56299) is the client's IP port for the connection to the server (the so-called ephemeral port).
Clients will reuse that port. The _pair_ of source IP/port is unique: but _only_ for a given point in time.
o So is there a way (API) to get the client unique id (except to
get a substr of this)?
No. Eg Autobahn now can run WebSocket not only over TCP but also over Unix pipes or domain sockets (which don't even have IP addresses).
Above string should be considered a debugging aid (or for logging purposes). WAMP assigns unique _session_ IDs to clients (unrelated to IP/port). Each WAMP session (from same or differnt clients) will get unique WAMP session ID (which is just a random thing).
o This number seems unique so far, but will it be unique on
multiple server with multiple autobahn instance? I guess no but
Like above: client IP/port pairs are unique for a given moment in time.
o is this number any how related to client end code (JS or any
other client)? In short, can client modify this or get this
number any how?
o Is this okie to use this number as client id in our code or we
should create our own unique id per client?
Better use your onw "unique" thing. And: What is unique? Unique and persistent over time? If so, you probably better use a cookie or JS client storage. Don't use IP/port numbers.
Using cookies/client storage, you can store something random which can be unique for that browser and all it's connections to your server. 2 browsers on same user machine will have different cookies though.
* Some of android default browser does not support websocket and
flash. So the only option left is long polling. Does autobahn
provide the support of long-polling out of the box or we need to
write the complete code? Or there is a any other solution for that.
The upcoming WAMPv2 will have a HTTP long-poll transport (besides WebSocket) .. it'll be here (not yet finished):
* Is there an api support for timer instance per client, like to do
something per client periodically? For example send every client a
msg after 10 mins of it's joining.
self.sendMessage("hey, still handing around?")
So far I loved this technology :).
Great! Feel free to ask more;)
Am 11.01.2014 00:17, schrieb Chuck James:
You received this message because you are subscribed to the Google
Groups "Autobahn" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to autobahnws+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.