Skip to content

Commit

Permalink
Don't await for the duration of websocket sessions. (#1412)
Browse files Browse the repository at this point in the history
  • Loading branch information
DDEfromOR authored and stevengum committed Nov 14, 2019
1 parent d2d81d1 commit 3aea9c0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions libraries/botbuilder/src/botFrameworkAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1179,8 +1179,9 @@ export class BotFrameworkAdapter extends BotAdapter implements IUserTokenProvide

const upgrade = (res as any).claimUpgrade();
const socket = this.webSocketFactory.createWebSocket(req as IncomingMessage, upgrade.socket, upgrade.head);
this.startWebSocket(socket);

await this.startWebSocket(socket);
return;
}

private async authenticateConnection(req: WebRequest, channelService?: string): Promise<void> {
Expand All @@ -1205,9 +1206,9 @@ export class BotFrameworkAdapter extends BotAdapter implements IUserTokenProvide
* Connects the handler to a WebSocket server and begins listening for incoming requests.
* @param socket The socket to use when creating the server.
*/
private async startWebSocket(socket: ISocket): Promise<void>{
private startWebSocket(socket: ISocket): void{
this.streamingServer = new WebSocketServer(socket, this);
await this.streamingServer.start();
this.streamingServer.start();
}

private async readRequestBodyAsString(request: IReceiveRequest): Promise<Activity> {
Expand Down

0 comments on commit 3aea9c0

Please sign in to comment.