Simple Geolocalization and Course Transmission Protocol (SGCTP)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Pages
transmit_udp.hpp
Go to the documentation of this file.
1 // INDENTING (emacs/vi): -*- mode:c++; tab-width:2; c-basic-offset:2; intent-tabs-mode:nil; -*- ex: set tabstop=2 expandtab:
2 
3 /*
4  * Simple Geolocalization and Course Transmission Protocol (SGCTP)
5  * Copyright (C) 2014 Cedric Dufour <http://cedric.dufour.name>
6  *
7  * The Simple Geolocalization and Course Transmission Protocol (SGCTP) is
8  * free software:
9  * you can redistribute it and/or modify it under the terms of the GNU General
10  * Public License as published by the Free Software Foundation, Version 3.
11  *
12  * The Simple Geolocalization and Course Transmission Protocol (SGCTP) is
13  * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
14  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
15  * PARTICULAR PURPOSE.
16  *
17  * See the GNU General Public License for more details.
18  */
19 
20 #ifndef SGCTP_CTRANSMIT_UDP_HPP
21 #define SGCTP_CTRANSMIT_UDP_HPP
22 
23 // SGCTP
24 #include "sgctp/transmit.hpp"
25 
26 
27 // SGCTP namespace
28 namespace SGCTP
29 {
30 
32 
35  class CTransmit_UDP: public CTransmit
36  {
37 
38  //----------------------------------------------------------------------
39  // CONSTRUCTORS / DESTRUCTOR
40  //----------------------------------------------------------------------
41 
42  public:
44  : CTransmit()
45  {};
46  virtual ~CTransmit_UDP()
47  {};
48 
49 
50  //----------------------------------------------------------------------
51  // METHODS: CTransmit (implement/override)
52  //----------------------------------------------------------------------
53 
54  protected:
55  virtual int send( int _iSocket,
56  const void *_pBuffer,
57  int _iSize,
58  int _iFlags );
59 
60  virtual int recv( int _iSocket,
61  void *_pBuffer,
62  int _iSize,
63  int _iFlags );
64 
65  public:
67  {
68  return TRANSMIT_UDP;
69  };
70 
71  virtual int alloc();
72 
73  virtual int unserialize( int _iDescriptor,
74  CData *_poData,
75  int _iMaxSize = 0 );
76 
77  };
78 
79 }
80 
81 #endif // SGCTP_CTRANSMIT_UDP_HPP
virtual ETransmitType getTransmitType()
Return the transmission type.
ETransmitType
Transmission types.
Definition: transmit.hpp:58
virtual int unserialize(int _iDescriptor, CData *_poData, int _iMaxSize=0)
Unserialize the SGCTP data from the given descriptor.
virtual int send(int _iSocket, const void *_pBuffer, int _iSize, int _iFlags)
Send data to the given descriptor.
SGCTP data container.
Definition: data.hpp:44
UDP transmission of SGCTP payload.
Generic transmission of SGCTP payload.
Definition: transmit.hpp:46
virtual int recv(int _iSocket, void *_pBuffer, int _iSize, int _iFlags)
Receive data from the given descriptor.
virtual int alloc()
Allocate resources required for data transmission (un-/serialization)