Changeset 668 for trunk/user


Ignore:
Timestamp:
Oct 10, 2020, 6:38:47 PM (4 years ago)
Author:
alain
Message:

typos...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/user/tcp_server/tcp_server.c

    r660 r668  
    129129        exit( 0 );
    130130    }
    131     else
    132     {
    133         printf("\n[server] listening socket[%x,%d] bound : [%x,%x]\n",
    134         pid, listen_fdid, server_sin.sin_addr, server_sin.sin_port );
    135     }
     131
     132    printf("\n[server] listening socket[%x,%d] bound : [%x,%x]\n",
     133    pid, listen_fdid, server_sin.sin_addr, server_sin.sin_port );
    136134
    137135    // 3. Listen clients connection requests
     
    144142        exit( 0 );
    145143    }
    146     else
    147     {
    148         printf("\n[server] listening socket[%x,%d] waiting connection request\n",
    149         pid, listen_fdid );
    150     }
    151144
     145    printf("\n[server] listening socket[%x,%d] waiting connection request\n",
     146    pid, listen_fdid );
    152147   
    153148    // 4. accept connection(s)
     
    156151                        &addr_length );
    157152
    158     if( chat_fdid == -1 )
     153    if( chat_fdid < 0 )
    159154    {
    160155        printf("\n[server error] accept failure on socket[%x,%d]\n",
     
    162157        exit( 0 );
    163158    }
    164     else
    165     {
    166         printf("\n[server] chat socket[%x,%d] accepted client [%x,%x]\n",
    167         pid, chat_fdid , client_sin.sin_addr , client_sin.sin_port );
    168     }
     159
     160    printf("\n[server] chat socket[%x,%d] accepted client [%x,%x]\n",
     161    pid, chat_fdid , client_sin.sin_addr , client_sin.sin_port );
    169162
    170163    // 5. call chat function
    171     // server_chat( chat_fdid );
     164    server_chat( chat_fdid );
    172165
    173166    // 6. close listen and chat sockets
    174 
    175     printf("\n[server] before close socket[%x,%d]\n", pid, chat_fdid );
    176 
    177167    close( chat_fdid );
    178 
    179     printf("\n[server] after close socket[%x,%d]\n", pid, chat_fdid );
    180 
    181168    close( listen_fdid );
    182169
Note: See TracChangeset for help on using the changeset viewer.