2 -- Licensed to the Apache Software Foundation (ASF) under one
3 -- or more contributor license agreements. See the NOTICE file
4 -- distributed with this work for additional information
5 -- regarding copyright ownership. The ASF licenses this file
6 -- to you under the Apache License, Version 2.0 (the
7 -- "License"); you may not use this file except in compliance
8 -- with the License. You may obtain a copy of the License at
10 -- http://www.apache.org/licenses/LICENSE-2.0
12 -- Unless required by applicable law or agreed to in writing,
13 -- software distributed under the License is distributed on an
14 -- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 -- KIND, either express or implied. See the License for the
16 -- specific language governing permissions and limitations
23 import qualified Control.Exception
24 import qualified Network
26 import Thrift.Protocol.Binary
28 import Thrift.Transport.Handle
30 import qualified ThriftTestUtils
32 import qualified Yowza
33 import qualified Yowza_Client as Client
34 import qualified Yowza_Iface as Iface
37 data YowzaHandler = YowzaHandler
38 instance Iface.Yowza_Iface YowzaHandler where
40 ThriftTestUtils.serverLog "SERVER: Got blingity"
44 ThriftTestUtils.serverLog "SERVER: Got blangity"
48 client :: (String, Network.PortID) -> IO ()
51 let ps = (BinaryProtocol to, BinaryProtocol to)
55 rv <- Client.blangity ps
56 ThriftTestUtils.clientLog $ show rv
60 server :: Network.PortNumber -> IO ()
62 ThriftTestUtils.serverLog "Ready..."
63 (runBasicServer YowzaHandler Yowza.process port)
64 `Control.Exception.catch`
65 (\(TransportExn s _) -> error $ "FAILURE: " ++ show s)
68 main = ThriftTestUtils.runTest server client