#ifndef LYXSOCKET_H
#define LYXSOCKET_H
+#include "support/filename.h"
#include "support/socktools.h"
#include "lyxfunc.h"
#include <string>
#include <map>
+
+namespace lyx {
+
class LyXServerSocket;
class LyXDataSocket;
class LyXServerSocket {
public:
///
- LyXServerSocket(LyXFunc *, std::string const &);
+ LyXServerSocket(LyXFunc *, support::FileName const &);
///
~LyXServerSocket();
/// Address of the local socket
- std::string const & address() const;
+ std::string const address() const;
/// To be called when there is activity in the server socket
void serverCallback();
/// To be called when there is activity in the data socket
/// File descriptor for the server socket
int fd_;
/// Stores the socket filename
- std::string address_;
+ support::FileName address_;
/// Maximum number of simultaneous clients
enum {
- MAX_CLIENTS = 10
- };
+ MAX_CLIENTS = 10
+ };
/// All connections
std::map<int, boost::shared_ptr<LyXDataSocket> > clients;
};
std::string buffer_;
};
+/// Implementation is in lyx_main.C
+extern LyXServerSocket & theLyXServerSocket();
+
+
+} // namespace lyx
+
#endif // LYXSOCKET_H