Skip to content

Commit

Permalink
Revert "Don't await for the duration of websocket sessions. (#1412)" (#…
Browse files Browse the repository at this point in the history
…1417)

This reverts commit 3aea9c0.
  • Loading branch information
stevengum authored Nov 14, 2019
1 parent 3aea9c0 commit e1411c0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions libraries/botbuilder/src/botFrameworkAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1179,9 +1179,8 @@ 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);

return;
await this.startWebSocket(socket);
}

private async authenticateConnection(req: WebRequest, channelService?: string): Promise<void> {
Expand All @@ -1206,9 +1205,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 startWebSocket(socket: ISocket): void{
private async startWebSocket(socket: ISocket): Promise<void>{
this.streamingServer = new WebSocketServer(socket, this);
this.streamingServer.start();
await this.streamingServer.start();
}

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

0 comments on commit e1411c0

Please sign in to comment.