44#if defined(_MSC_VER) || defined(__MINGW32__)
86 FGfdmSocket(
const std::string& address,
int port,
int protocol,
int precision = 7);
95 FGfdmSocket(
int port,
int protocol,
int precision = 7);
108 void Send(
const char *data,
int length);
109 void Send(
const std::string& data) {
Send(data.c_str(), data.length()); }
124 int Reply(
const std::string& text);
145 void Append(
double value);
162 void Clear(
const std::string& s);
177 enum ProtocolType {ptUDP, ptTCP};
180#if defined(_MSC_VER) || defined(__MINGW32__)
187 ProtocolType Protocol;
188 struct sockaddr_in scktName;
189 struct hostent *host;
190 std::ostringstream buffer;
193 void LogSocketError(
const std::string& msg);
194 void Debug(
int from);
The FGfdmSocket class enables JSBSim to communicate via sockets.
std::string Receive(void)
Receive data from the socket connection.
bool GetConnectStatus(void)
Return the connection status of the socket.
void Clear(void)
Clear the internal buffer.
void Append(const std::string &s)
Append the specified string to the internal buffer.
void Close(void)
Close the socket connection if the protocol is TCP.
void WaitUntilReadable(void)
Wait until the TCP socket is readable.
int Reply(const std::string &text)
Send a reply to the client ending by a prompt "JSBSim>".
void Send(void)
Send the internal buffer over the socket connection.
Main namespace for the JSBSim Flight Dynamics Model.