SMTPClient.cc

Go to the documentation of this file.
00001 /*
00002  *    Copyright 2005-2006 Intel Corporation
00003  * 
00004  *    Licensed under the Apache License, Version 2.0 (the "License");
00005  *    you may not use this file except in compliance with the License.
00006  *    You may obtain a copy of the License at
00007  * 
00008  *        http://www.apache.org/licenses/LICENSE-2.0
00009  * 
00010  *    Unless required by applicable law or agreed to in writing, software
00011  *    distributed under the License is distributed on an "AS IS" BASIS,
00012  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  *    See the License for the specific language governing permissions and
00014  *    limitations under the License.
00015  */
00016 
00017 
00018 #include "SMTPClient.h"
00019 
00020 namespace oasys {
00021 
00022 SMTPClient::SMTPClient(const char* logpath)
00023     : TCPClient(logpath, true /* init_socket_immediately */ ),
00024       in_(this), out_(this),
00025       smtp_(&in_, &out_, SMTP::DEFAULT_CONFIG, logpath),
00026       first_session_(true)
00027 {
00028 }
00029 
00030 int
00031 SMTPClient::send_message(SMTPSender* sender)
00032 {
00033     int ret = smtp_.client_session(sender, first_session_);
00034     first_session_ = false;
00035     return ret;
00036 }
00037 
00038 SMTPFdClient::SMTPFdClient(int fd_in, int fd_out, const char* logpath)
00039     : fdio_in_(fd_in), fdio_out_(fd_out),
00040       in_(&fdio_in_), out_(&fdio_out_),
00041       smtp_(&in_, &out_, SMTP::DEFAULT_CONFIG, logpath),
00042       first_session_(true)
00043 {
00044 }
00045 
00046 int
00047 SMTPFdClient::send_message(SMTPSender* sender)
00048 {
00049     int ret = smtp_.client_session(sender, first_session_);
00050     first_session_ = false;
00051     return ret;
00052 }
00053 
00054 } // namespace oasys

Generated on Sat Sep 8 08:36:18 2007 for DTN Reference Implementation by  doxygen 1.5.3