Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created April 15, 2024 16:37
Show Gist options
  • Save bjoerntx/59a0327eca8f1b2854a2f6f6149336ff to your computer and use it in GitHub Desktop.
Save bjoerntx/59a0327eca8f1b2854a2f6f6149336ff to your computer and use it in GitHub Desktop.
[HttpPost]
public HttpResponseMessage LoadDocument(string ConnectionID)
{
// connect the WebSocketHandler with the ConnectionID
WebSocketHandler wsHandler = WebSocketHandler.GetInstance(ConnectionID);
// the document directly server-side
wsHandler.LoadText("Documents/demo.tx", StreamType.InternalUnicodeFormat);
return new HttpResponseMessage()
{
StatusCode = HttpStatusCode.OK
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment