In the receiver side code, in the main() function, it is receiving the data from the sender but I am unable to display it on the receiver terminal. Server.c: This files receives the Data Frame from the Client and sends the Acknowledgement. There are 2 files: Client.c: This file sends Data Frame to the Server and waits for the Acknowledgement. Throw SocketException ( "Could not read from socket." ) ĬlientSocket client_socket ( "localhost", 30000 ) Ĭout << "We received this response from the server:\n\"" << reply << "\"\n" Ĭout << "Exception was caught:" << e.description() << "\n" server.c README.md Stop-and-Wait-Protocol-Implemented-in-UDP-C This program on STOP and WAIT ARQ Protocol in C. Throw SocketException ( "Could not bind to port." ) Ĭonst ClientSocket& ClientSocket::operator > ( std::string& s ) const Throw SocketException ( "Could not create client socket." ) Implementation of the ClientSocket classĬlientSocket::ClientSocket ( std::string host, int port ) ![]() If ( new_socket.m_sock > ( std::string& ) const New_socket.m_sock = ::accept ( m_sock, ( sockaddr * ) &m_addr, ( socklen_t * ) &addr_length ) Int listen_return = ::listen ( m_sock, MAXCONNECTIONS ) īool Socket::accept ( Socket& new_socket ) const If ( setsockopt ( m_sock, SOL_SOCKET, SO_REUSEADDR, ( const char* ) &on, sizeof ( on ) ) = -1 ) SocketException ( std::string s ) : m_s ( s ) Reciever side code: // SocketException class
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |