orca-sim
|
This class implements an asynchonous udp server. More...
#include <UdpAsyncServer.hpp>
Public Member Functions | |
UdpAsyncServer (int port) | |
Default ctor. More... | |
~UdpAsyncServer () | |
int | Send (char *data, int length) |
Send a reply to the GDB client. More... | |
int | Receive (char *data) |
Receives data from the GDB client. More... | |
void | Error (UdpAsyncError err) |
Private Attributes | |
fd_set | original_socket |
fd_set | original_stdin |
fd_set | readfds |
fd_set | writefds |
struct timeval | tv |
int | numfd |
int | socket_fd |
int | bytes_read |
unsigned int | address_length |
char * | recieve_data [MAX_LENGTH] |
char | send_data [MAX_LENGTH] |
struct sockaddr_in server_address | client_address |
This class implements an asynchonous udp server.
We use select() to interrupt the simulation only when there is some packet for the gdb server.
Definition at line 58 of file UdpAsyncServer.hpp.
|
explicit |
Default ctor.
port | UDP port number to run the server. |
Definition at line 51 of file UdpAsyncServer.cpp.
UdpAsyncServer::~UdpAsyncServer | ( | ) |
Definition at line 127 of file UdpAsyncServer.cpp.
void UdpAsyncServer::Error | ( | UdpAsyncError | err | ) |
Definition at line 32 of file UdpAsyncServer.cpp.
int UdpAsyncServer::Receive | ( | char * | data | ) |
Receives data from the GDB client.
data | Location to store data in. |
Definition at line 101 of file UdpAsyncServer.cpp.
int UdpAsyncServer::Send | ( | char * | data, |
int | length | ||
) |
Send a reply to the GDB client.
data | Data to be send |
length | The number of bytes to send |
Definition at line 96 of file UdpAsyncServer.cpp.
|
private |
Definition at line 68 of file UdpAsyncServer.hpp.
|
private |
Definition at line 67 of file UdpAsyncServer.hpp.
|
private |
Definition at line 70 of file UdpAsyncServer.hpp.
|
private |
Definition at line 66 of file UdpAsyncServer.hpp.
|
private |
Definition at line 60 of file UdpAsyncServer.hpp.
|
private |
Definition at line 61 of file UdpAsyncServer.hpp.
|
private |
Definition at line 62 of file UdpAsyncServer.hpp.
|
private |
Definition at line 69 of file UdpAsyncServer.hpp.
|
private |
Definition at line 69 of file UdpAsyncServer.hpp.
|
private |
Definition at line 67 of file UdpAsyncServer.hpp.
|
private |
Definition at line 65 of file UdpAsyncServer.hpp.
|
private |
Definition at line 63 of file UdpAsyncServer.hpp.