blob: 01b91131f44bb69fc1b100b99d015227300dadd1 [file] [log] [blame]
David Reiss5ddabb82010-10-06 17:09:37 +00001/*
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
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
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
17 * under the License.
18 */
19
Roger Meier49ff8b12012-04-13 09:12:31 +000020#include <thrift/async/TAsyncChannel.h>
David Reiss5ddabb82010-10-06 17:09:37 +000021
Konrad Grochowski16a23a62014-11-13 15:33:38 +010022namespace apache {
23namespace thrift {
24namespace async {
David Reiss5ddabb82010-10-06 17:09:37 +000025
Roger Meier285cfaa2011-07-28 17:51:36 +000026void TAsyncChannel::sendAndRecvMessage(const VoidCallback& cob,
David Reiss5ddabb82010-10-06 17:09:37 +000027 TMemoryBuffer* sendBuf,
28 TMemoryBuffer* recvBuf) {
cyy316723a2019-01-05 16:35:14 +080029 std::function<void()> send_done
30 = std::bind(&TAsyncChannel::recvMessage, this, cob, recvBuf);
David Reiss5ddabb82010-10-06 17:09:37 +000031
Roger Meier285cfaa2011-07-28 17:51:36 +000032 sendMessage(send_done, sendBuf);
David Reiss5ddabb82010-10-06 17:09:37 +000033}
Konrad Grochowski16a23a62014-11-13 15:33:38 +010034}
35}
36} // apache::thrift::async