src/Network/UDP.hh
author terom
Sun, 07 Dec 2008 20:07:28 +0000
changeset 255 99431fdb0dc8
parent 202 b3f5d766391e
child 286 2a8f20a53ff2
permissions -rw-r--r--
add PixelDimension/PixelCoordinate types, convert Terrain to use them, and convert/clean up drawing code
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
     1
#ifndef NETWORK_UDP_HH
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
     2
#define NETWORK_UDP_HH
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
     3
186
0738f2949a2b move src/Network% to src/Network/%
terom
parents: 185
diff changeset
     4
#include "Socket.hh"
0738f2949a2b move src/Network% to src/Network/%
terom
parents: 185
diff changeset
     5
#include "Address.hh"
0738f2949a2b move src/Network% to src/Network/%
terom
parents: 185
diff changeset
     6
#include "Packet.hh"
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
     7
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
     8
class NetworkUDP {
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
     9
    private:
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    10
        NetworkSocket socket;
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    11
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    12
        CL_SlotContainer slots;
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    13
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    14
    public:
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    15
        NetworkUDP (void);
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    16
        NetworkUDP (const NetworkAddress &bind_addr);
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    17
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    18
    private:
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    19
        void on_recv (void);
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    20
200
2dbf40661580 better NetworkBuffer/Packet stuff + some additional Physics+Network stuff + random fixes
terom
parents: 186
diff changeset
    21
        CL_Signal_v2<NetworkPacketInput&, const NetworkAddress&> _sig_packet;
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    22
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    23
    public:
202
b3f5d766391e support sending of raw packets
terom
parents: 200
diff changeset
    24
        bool sendto (const NetworkPacketBuffer &packet, const NetworkAddress &dst);
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    25
        
200
2dbf40661580 better NetworkBuffer/Packet stuff + some additional Physics+Network stuff + random fixes
terom
parents: 186
diff changeset
    26
        CL_Signal_v2<NetworkPacketInput&, const NetworkAddress&>& sig_packet (void) { return _sig_packet; }
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    27
};
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    28
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    29
#endif /* NETWORK_UDP_HH */