mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
49 lines
908 B
C
49 lines
908 B
C
|
|
/*
|
||
|
|
* SocketStreams.h
|
||
|
|
*
|
||
|
|
* Created on: Sep 27, 2012
|
||
|
|
* Author: Mitchell Wills
|
||
|
|
*/
|
||
|
|
|
||
|
|
#ifndef SOCKETSTREAMS_H_
|
||
|
|
#define SOCKETSTREAMS_H_
|
||
|
|
|
||
|
|
|
||
|
|
class SocketStreams;
|
||
|
|
|
||
|
|
|
||
|
|
#include "networktables2/stream/IOStreamFactory.h"
|
||
|
|
#include "networktables2/stream/IOStreamProvider.h"
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Static factory for socket stream factories and providers
|
||
|
|
*
|
||
|
|
* @author Mitchell
|
||
|
|
*
|
||
|
|
*/
|
||
|
|
class SocketStreams {
|
||
|
|
public:
|
||
|
|
/**
|
||
|
|
* Create a new IOStream factory
|
||
|
|
* @param host
|
||
|
|
* @param port
|
||
|
|
* @return a IOStreamFactory that will create Socket Connections on the given host and port
|
||
|
|
* @throws IOException
|
||
|
|
*/
|
||
|
|
static IOStreamFactory& newStreamFactory(const char* host, int port);
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Create a new IOStream provider
|
||
|
|
* @param port
|
||
|
|
* @return an IOStreamProvider for a socket server on the given port
|
||
|
|
* @throws IOException
|
||
|
|
*/
|
||
|
|
static IOStreamProvider& newStreamProvider(int port);
|
||
|
|
};
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
#endif /* SOCKETSTREAMS_H_ */
|