当前位置: 技术问答>linux和unix
tcp client 疑问
来源: 互联网 发布时间:2016-07-17
本文导语: 不好意思,没分了,我写了个tcp client while ( TRUE ) { p = input; printf( "nplease input msg[]:input "exit", go back to shelln " ); while( ( ( c = getchar() ) != 'n' ) && ( c != EOF ) ) { *p++ = c; *p = 0; } ...
不好意思,没分了,我写了个tcp client
while ( TRUE )
{
p = input;
printf( "nplease input msg[]:input "exit", go back to shelln " );
while( ( ( c = getchar() ) != 'n' ) && ( c != EOF ) )
{
*p++ = c;
*p = 0;
}
//printf( "nyou inputed %sn", input );
if ( strcmp( input, "exit" ) == 0 )
{
break;
}
//if( ( ssock = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP ) )
while ( TRUE )
{
p = input;
printf( "nplease input msg[]:input "exit", go back to shelln " );
while( ( ( c = getchar() ) != 'n' ) && ( c != EOF ) )
{
*p++ = c;
*p = 0;
}
//printf( "nyou inputed %sn", input );
if ( strcmp( input, "exit" ) == 0 )
{
break;
}
//if( ( ssock = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP ) )