Skip to content

Commit

Permalink
Merge branch 'issue2_udp_init' into issue89_simulator_depends
Browse files Browse the repository at this point in the history
  • Loading branch information
shaun-edwards committed Mar 11, 2015
2 parents 451a98f + 5af3191 commit d9829a4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
7 changes: 6 additions & 1 deletion simple_message/include/simple_message/socket/simple_socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,12 @@ class SimpleSocket : public industrial::smpl_msg_connection::SmplMsgConnection
/**
* \brief Constructor
*/
SimpleSocket(){}
SimpleSocket()
{
this->setSockHandle(this->SOCKET_FAIL);
memset(&this->sockaddr_, 0, sizeof(this->sockaddr_));
this->setConnected(false);
}

/**
* \brief Destructor
Expand Down
6 changes: 0 additions & 6 deletions simple_message/src/socket/tcp_socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,10 @@ namespace tcp_socket
{

TcpSocket::TcpSocket()
// Constructor for UDP socket object
{
this->setSockHandle(this->SOCKET_FAIL);
memset(&this->sockaddr_, 0, sizeof(this->sockaddr_));
this->setConnected(false);

}

TcpSocket::~TcpSocket()
// Destructor for UDP socket object
// Closes socket
{
LOG_DEBUG("Destructing TCPSocket");
Expand Down
4 changes: 0 additions & 4 deletions simple_message/src/socket/udp_socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,9 @@ namespace udp_socket
UdpSocket::UdpSocket()
// Constructor for UDP socket object
{
this->setSockHandle(this->SOCKET_FAIL);
memset(&this->sockaddr_, 0, sizeof(this->sockaddr_));
memset(&this->udp_read_buffer_, 0, sizeof(this->udp_read_buffer_));
udp_read_head_ = this->udp_read_buffer_;
udp_read_len_ = 0;
this->setConnected(false);

}

UdpSocket::~UdpSocket()
Expand Down

0 comments on commit d9829a4

Please sign in to comment.