Created
November 17, 2014 15:56
-
-
Save FunctionalFirst/0348951e82335a5add3d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let rec AsyncAcceptMessages(client : WebSocket) = | |
async { | |
let! message = client.AsyncReadMessage | |
if(not(isNull message)) then | |
let s = | |
use reader = new StreamReader(message) | |
reader.ReadToEnd() | |
do | |
use writer = new StreamWriter(client.CreateMessageWriter(WebSocketMessageType.Text), Encoding.UTF8) | |
writer.Write s | |
printf "%s" <| s | |
do! AsyncAcceptMessages client | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment