/usr/include/assa-3.5/assa/UDPSocket.h is in libassa-3.5-5-dev 3.5.1-6build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | // -*- c++ -*-
//------------------------------------------------------------------------------
// UDPSocket.h
//------------------------------------------------------------------------------
// Copyright (c) 1999,2006 by Vladislav Grinchenko
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//------------------------------------------------------------------------------
// Created: 03/22/99
//------------------------------------------------------------------------------
#ifndef UDP_SOCKET_H
#define UDP_SOCKET_H
#include "assa/Socket.h"
namespace ASSA {
/** @file UDPSocket.h
*
* Class UDPSocket is an implementation of
* UNIX domain socket that is the base class for more specialized
* domain socket classes.
*/
class UDPSocket : public Socket {
public:
/// Default constructor
UDPSocket ()
{
trace("UDPSocket::UDPSocket()");
}
/** Constructor
* @param fd_ file descriptor to use
*/
UDPSocket (const handler_t fd_)
{
trace("UDPSocket::UDPSocket(fd)");
m_fd = fd_;
}
/** Destructor will close connection */
virtual ~UDPSocket ()
{
trace("UDPSocket::~UDPSocket");
}
/** Create socket. Socket domain type is specified as
* AF_INET for internet socket and AF_UNIX for UNIX domain socket
* (full duplex pipe).
*
* @param domain_ domain
* @return true if socket is created successfully, false otherwise
*/
bool open (const int domain_);
/** Close socket connection.
* @return true if success, fail if call to close() failed.
*/
bool close ();
/** Server in UDP client-server scenario has to bind socket
* to its local well-known port. This is the same bind call as
* in IPv4 - maybe it should be generalized in parent class.
*
* @param my_address_ address to bind to
*/
bool bind (const Address& my_address_);
/// Get socket file descriptor
handler_t getHandler() const { return m_fd; }
/// Get socket domain type
const int getDomain() const { return m_type; }
protected:
/// Set file descriptor
void setHandler(const int fd_) { m_fd = fd_; }
/// Set socket domain type
void setDomain(const int type_) { m_type = type_; }
};
} // end namespace ASSA
#endif // UDP_SOCKET_H
|