Line 1... |
Line 1... |
// $Id: Rw11VirtTermTcp.cpp 516 2013-05-05 21:24:52Z mueller $
|
// $Id: Rw11VirtTermTcp.cpp 521 2013-05-20 22:16:45Z mueller $
|
//
|
//
|
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
// Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
//
|
//
|
// This program is free software; you may redistribute and/or modify it under
|
// This program is free software; you may redistribute and/or modify it under
|
// the terms of the GNU General Public License as published by the Free
|
// the terms of the GNU General Public License as published by the Free
|
Line 11... |
Line 11... |
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
// for complete details.
|
// for complete details.
|
//
|
//
|
// Revision History:
|
// Revision History:
|
// Date Rev Version Comment
|
// Date Rev Version Comment
|
|
// 2013-05-17 512 1.0.3 use Rtools::String2Long
|
// 2013-05-05 516 1.0.2 fix mistakes in emsg generation with errno
|
// 2013-05-05 516 1.0.2 fix mistakes in emsg generation with errno
|
// 2013-04-20 508 1.0.1 add fSndPreConQue handling
|
// 2013-04-20 508 1.0.1 add fSndPreConQue handling
|
// 2013-03-06 495 1.0 Initial version
|
// 2013-03-06 495 1.0 Initial version
|
// 2013-02-13 488 0.1 First draft
|
// 2013-02-13 488 0.1 First draft
|
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
|
|
/*!
|
/*!
|
\file
|
\file
|
\version $Id: Rw11VirtTermTcp.cpp 516 2013-05-05 21:24:52Z mueller $
|
\version $Id: Rw11VirtTermTcp.cpp 521 2013-05-20 22:16:45Z mueller $
|
\brief Implemenation of Rw11VirtTermTcp.
|
\brief Implemenation of Rw11VirtTermTcp.
|
*/
|
*/
|
|
|
#include <stdlib.h>
|
|
#include <sys/types.h>
|
#include <sys/types.h>
|
#include <sys/socket.h>
|
#include <sys/socket.h>
|
#include <netdb.h>
|
#include <netdb.h>
|
#include <string.h>
|
#include <string.h>
|
|
|
Line 124... |
Line 124... |
|
|
fTcpTrace = fUrl.FindOpt("trace");
|
fTcpTrace = fUrl.FindOpt("trace");
|
|
|
string port;
|
string port;
|
fUrl.FindOpt("port",port);
|
fUrl.FindOpt("port",port);
|
int portno = atoi(port.c_str());
|
unsigned long portno;
|
// FIXME_code: error handling ...
|
if (!Rtools::String2Long(port, portno, emsg)) return false;
|
|
|
protoent* pe = getprotobyname("tcp");
|
protoent* pe = getprotobyname("tcp");
|
if (pe == 0) {
|
if (pe == 0) {
|
emsg.Init("Rw11VirtTermTcp::Open","getprotobyname(\"tcp\") failed");
|
emsg.Init("Rw11VirtTermTcp::Open","getprotobyname(\"tcp\") failed");
|
return false;
|
return false;
|