Changeset 213 in flair-src for trunk/lib/FlairCore/src/TcpSocket.cpp


Ignore:
Timestamp:
01/30/18 17:47:12 (4 years ago)
Author:
Sanahuja Guillaume
Message:

thread stack size rework
add Matrix class

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairCore/src/TcpSocket.cpp

    r15 r213  
    6363
    6464TcpSocket *TcpSocket::Accept(Time timeout) {
    65   char errorMsg[256];
    6665  TcpSocket *acceptedSocket = nullptr;
    6766
     
    7776                   (timeout == 0) ? nullptr : &tv); // man 2 accept
    7877  if (ret < 0) {
     78    char errorMsg[256];
    7979    Err("select: %s\n", strerror_r(errno, errorMsg, sizeof(errorMsg)));
    8080  } else {
     
    9090      if ((acceptedSocket->socket =
    9191               accept(socket, (sockaddr *)&their_addr, &namelen)) < 0) {
     92        char errorMsg[256];
    9293        Err("error: %s\n", strerror_r(errno, errorMsg, sizeof(errorMsg)));
    9394        delete acceptedSocket;
     
    103104                        const std::string distantAddress, Time timeout) {
    104105  bool success = false;
    105   char errorMsg[256];
    106106
    107107  if (isConnected) {
     
    132132  if (connect(socket, (sockaddr *)&serv_addr, sizeof(serv_addr)) == -1) {
    133133    if ((errno != EINPROGRESS) && (errno != EAGAIN)) {
     134      char errorMsg[256];
    134135      Err("socket connect: %s\n",
    135136          strerror_r(errno, errorMsg, sizeof(errorMsg)));
     
    149150                 (timeout == 0) ? NULL : &tv); // man 2 connect EINPROGRESS
    150151      if (ret < 0) {
     152        char errorMsg[256];
    151153        Err("select: %s\n", strerror_r(errno, errorMsg, sizeof(errorMsg)));
    152154        success = false;
     
    161163          socklen_t len = sizeof(error);
    162164          if (getsockopt(socket, SOL_SOCKET, SO_ERROR, &error, &len) != 0) {
    163             // Err("getsockopt:
    164             // %s\n",strerror_r(errno,errorMsg,sizeof(errorMsg)));
     165            //char errorMsg[256];
     166            // Err("getsockopt: %s\n",strerror_r(errno,errorMsg,sizeof(errorMsg)));
    165167            success = false;
    166168          } else if (error != 0) {
    167             // Err("socket error:
    168             // %d(%s)\n",error,strerror_r(error,errorMsg,sizeof(errorMsg)));
     169            //char errorMsg[256];
     170            // Err("socket error: %d(%s)\n",error,strerror_r(error,errorMsg,sizeof(errorMsg)));
    169171            success = false;
    170172          } else {
Note: See TracChangeset for help on using the changeset viewer.