[
https://issues.apache.org/jira/browse/TINKERPOP-1695?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16058312#comment-16058312
]
Charlie commented on TINKERPOP-1695:
------------------------------------
Here is a python example using tornado.
{code:none}
import uuid
from tornado import websocket, ioloop
loop = ioloop.IOLoop()
socket = loop.run_sync(lambda:
websocket.websocket_connect("ws://127.0.0.1:8182/gremlin"))
first_message = b'\x10application/json{"processor": "session", "requestId":
"d52ba43b-1c82-4965-abef-918e6bef420a", "args": {"gremlin": "g.V().count()",
"session": "8c13e3b8-b322-41e3-81a3-a879e12a0343", "language":
"gremlin-groovy", "bindings": {}, "scriptEvaluationTimeout": 600000, "aliases":
{}}, "op": "eval"}'
close_message = b'\x10application/json{"processor": "session", "requestId":
"e9a7602a-b7f9-4983-8175-238e1f307776", "args": {"gremlin": null, "session":
"8c13e3b8-b322-41e3-81a3-a879e12a0343", "language": "gremlin-groovy",
"bindings": null, "scriptEvaluationTimeout": null, "aliases": {}}, "op":
"close"}'
# send message so it knows about new session
loop.run_sync(lambda: socket.write_message(first_message, binary=True))
print "First message sent."
# read message, don't care
resp = loop.run_sync(lambda: socket.read_message())
print "Message response: %s" % resp
# send close message
loop.run_sync(lambda: socket.write_message(close_message, binary=True))
print "Close message sent."
# Hang here forever since no message is received
resp = loop.run_sync(lambda: socket.read_message())
print "Close response: %s" % resp
socket.close()
{code}
> Session close over websocket does not reply with confirmation
> -------------------------------------------------------------
>
> Key: TINKERPOP-1695
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1695
> Project: TinkerPop
> Issue Type: Bug
> Components: server
> Affects Versions: 3.2.3, 3.2.4
> Environment: Ubuntu 14.04
> Reporter: Charlie
> Priority: Minor
> Attachments: pcap_ws.png
>
>
> If you were to open up wireshark and monitor the websocket traffic and run
> the following in the gremlin console, you will see that a close message will
> get sent, but no confirmation back that the session actually closed.
> {code:java}
> gremlin> :remote console tinkerpop.server conf/remote.yaml session
> gremlin> :> g.V().count()
> gremlin> :remote close
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)