52 #ifndef __DEV_NET_TCP_IFACE_HH__
53 #define __DEV_NET_TCP_IFACE_HH__
148 TCPIface(std::string server_name,
unsigned server_port,
149 unsigned dist_rank,
unsigned dist_size,
151 bool use_pseudo_op,
bool is_switch,
int num_nodes);
156 #endif // __DEV_NET_TCP_IFACE_HH__
void initTransport() override
Init hook for the underlaying transport.
void sendCmd(const Header &header) override
Send out a control command to the remote end.
TCPIface(std::string server_name, unsigned server_port, unsigned dist_rank, unsigned dist_size, Tick sync_start, Tick sync_repeat, EventManager *em, bool use_pseudo_op, bool is_switch, int num_nodes)
The ctor creates and connects the stream socket to the server.
uint64_t Tick
Tick count type.
std::shared_ptr< EthPacketData > EthPacketPtr
void recvPacket(const Header &header, EthPacketPtr &packet) override
Receive a packet from the remote end.
void sendTCP(int sock, const void *buf, unsigned length)
Send out a message through a TCP stream socket.
static std::vector< int > sockRegistry
Storage for all opened sockets.
void establishConnection()
bool recvTCP(int sock, void *buf, unsigned length)
Receive the next incoming message through a TCP stream socket.
bool recvHeader(Header &header) override
Receive a header (i.e.
bool anyislistening() const
DistHeaderPkt::Header Header
Compute node info and storage for the very first connection from each node (used by the switch) ...
int sock
The stream socket to connect to the server.
static std::vector< std::pair< NodeInfo, int > > nodes
The interface class to talk to peer gem5 processes.
void sendPacket(const Header &header, const EthPacketPtr &packet) override
Send out a data packet to the remote end.