Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Creation Default Constructor for ServerSocket #70

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/server_socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ const char *ExceptionSocketClient::what() const throw()
return explaination_.c_str();
}

ServerSocket::ServerSocket() : ServerSocket(20222,10,INADDR_ANY) {}

ServerSocket::ServerSocket(unsigned int port, int max_connection_pending = 10,in_addr_t accept_from = INADDR_ANY)
{
// creation of the socket
Expand Down
2 changes: 1 addition & 1 deletion src/server_socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ class ServerSocket
* \param accept_from : source address accepted from the socket.
* default is INADDR_ANY
*/
ServerSocket(); //Default constructor , default port 20222 & 10 maximum pending connections
ServerSocket(unsigned int port, int max_connection_pending, in_addr_t accept_from);

/*!
Expand All @@ -173,7 +174,6 @@ class ServerSocket
*/
ClientSocket waitingForConnection();
private:
ServerSocket(); // forbid access to default constructor
int socket_fd_; /*< file descriptor for the socket */
struct sockaddr_in server_address_; /*< structure for ip, stores accepted addresses, port */
};
Expand Down