gameServer/stresstest.hs
changeset 1815 3d62cf9c350e
parent 1804 4e78ad846fb6
child 2352 7eaf82cf0890
equal deleted inserted replaced
1814:e5391d901cff 1815:3d62cf9c350e
    12 
    12 
    13 #if !defined(mingw32_HOST_OS)
    13 #if !defined(mingw32_HOST_OS)
    14 import System.Posix
    14 import System.Posix
    15 #endif
    15 #endif
    16 
    16 
    17 session1 nick room = ["NICK", nick, "", "PROTO", "24", "", "CHAT_STRING", "lobby 1", "", "CREATE", room, "", "CHAT_STRING", "room 1", "", "QUIT", "bye-bye", ""]
    17 session1 nick room = ["NICK", nick, "", "PROTO", "24", "", "CHAT", "lobby 1", "", "CREATE", room, "", "CHAT", "room 1", "", "QUIT", "bye-bye", ""]
    18 session2 nick room = ["NICK", nick, "", "PROTO", "24", "", "LIST", "", "JOIN", room, "", "CHAT_STRING", "room 2", "", "PART", "", "CHAT_STRING", "lobby after part", "", "QUIT", "bye-bye", ""]
    18 session2 nick room = ["NICK", nick, "", "PROTO", "24", "", "LIST", "", "JOIN", room, "", "CHAT", "room 2", "", "PART", "", "CHAT", "lobby after part", "", "QUIT", "bye-bye", ""]
    19 session3 nick room = ["NICK", nick, "", "PROTO", "24", "", "LIST", "", "JOIN", room, "", "CHAT_STRING", "room 2", "", "QUIT", "bye-bye", ""]
    19 session3 nick room = ["NICK", nick, "", "PROTO", "24", "", "LIST", "", "JOIN", room, "", "CHAT", "room 2", "", "QUIT", "bye-bye", ""]
    20 
    20 
    21 emulateSession sock s = do
    21 emulateSession sock s = do
    22 	mapM_ (\x -> hPutStrLn sock x >> hFlush sock >> randomRIO (50000::Int, 90000) >>= threadDelay) s
    22 	mapM_ (\x -> hPutStrLn sock x >> hFlush sock >> randomRIO (50000::Int, 90000) >>= threadDelay) s
    23 	hFlush sock
    23 	hFlush sock
    24 	threadDelay 225000
    24 	threadDelay 225000