libassa 3.5.1
Loading...
Searching...
No Matches
ConUDPSocket.h
Go to the documentation of this file.
1// -*- c++ -*-
2//------------------------------------------------------------------------------
3// ConUDPSocket.h
4//------------------------------------------------------------------------------
5// Copyright (C) 1997-2002 Vladislav Grinchenko
6//
7// This library is free software; you can redistribute it and/or
8// modify it under the terms of the GNU Library General Public
9// License as published by the Free Software Foundation; either
10// version 2 of the License, or (at your option) any later version.
11//------------------------------------------------------------------------------
12#ifndef CONUDP_SOCKET_H
13#define CONUDP_SOCKET_H
14
15#include "assa/UDPSocket.h"
16
17namespace ASSA {
18
24class ConUDPSocket : public UDPSocket {
25public:
28 char self[] = "ConUDPSocket::ConUDPSocket"; trace(self);
29 }
30
32 virtual ~ConUDPSocket () {
33 char self[] = "ConUDPSocket::~ConUDPSocket"; trace(self);
34 }
35
39 bool connect (const Address& peer_addr_);
40
42 void unconnect ();
43
54 int read (char* buf_, const unsigned int size_);
55
61 int write (const char* buf_ = NULL, const unsigned int size_ = 0);
62
63 virtual int in_avail () const { return 0; }
64};
65
66} // end namespace ASSA
67
68#endif // CONUDP_SOCKET_H
69
70
71
#define trace(s)
trace() is used to trace function call chain in C++ program.
Definition Logger.h:429
Class UDPSocket is an implementation of UNIX domain socket that is the base class for more specialize...
A wrapper class to provide AutoPtr with reference semantics.
Definition AutoPtr.h:32
bool connect(const Address &peer_addr_)
Connect socket to the peer.
ConUDPSocket()
Constructor.
void unconnect()
Unconnect connected socket.
virtual ~ConUDPSocket()
Destructor.
int write(const char *buf_=NULL, const unsigned int size_=0)
Perform blocking write by writing packet of specified size.
virtual int in_avail() const
This function returns the number of characters immediately available in the get area of the underly...
int read(char *buf_, const unsigned int size_)
Read specified number of bytes off the socket.