mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-14 13:06:30 +02:00
33 lines
773 B
C++
33 lines
773 B
C++
//
|
|
// UDPSocket.h
|
|
// interface
|
|
//
|
|
// Created by Stephen Birarda on 1/28/13.
|
|
// Copyright (c) 2013 High Fidelity, Inc. All rights reserved.
|
|
//
|
|
|
|
#ifndef __interface__UDPSocket__
|
|
#define __interface__UDPSocket__
|
|
|
|
#include <iostream>
|
|
#include <netinet/in.h>
|
|
|
|
class UDPSocket {
|
|
public:
|
|
static struct sockaddr_in sockaddr_util(char *address, int port);
|
|
|
|
UDPSocket(int listening_port);
|
|
int send(char * dest_address, int dest_port, const void *data, int length_in_bytes);
|
|
private:
|
|
UDPSocket(); // private default constructor
|
|
int handle;
|
|
|
|
struct AgentData {
|
|
char * address;
|
|
int listening_port;
|
|
};
|
|
|
|
AgentData *known_agents;
|
|
};
|
|
|
|
#endif /* defined(__interface__UDPSocket__) */
|