After using make here, the connection to the *.exe runs without problems. However, from the lights of the 8019 single-chip microcomputer received, the interval of the sent data is incorrect. I have used delay(30), in this case, the light of the 8019 on the receiving end should also light up once every 30ms. But it seems not right. I tracked the data step by step on the 8019 side and found that the data sent over seems to be correct. Why do I have to add *.lib in BC31? The reason is very simple, because I want to step through my own c file. But it's still not working now. The following is the.c source code that I modified after referring to the original \apps\tcptack in the DOS application WATTCP, and it sends 514 bytes over the network. The first 2 bytes represent that the length of the subsequent data packet is 512 bytes. The connection is successful through make. Please refer to and correct it. The fact shows that there is a problem with the interval of data sent by this code.
#include
#include
#include
#include
#include
#include
#define LIGHT_PORT 12345
int main(int argc, char *argv)
{
longword remoteip;
static tcp_Socket s;
char *host;
unsigned char inbuf,outbuf;
sock_init();
remoteip = inet_addr( "192.168.0.10" );
if ( !tcp_open( &s, 0, remoteip, LIGHT_PORT, NULL )) {
cputs("Unable to open connection."

;
exit( 1 );
}
printf("Connect..Sucess\n"

;
// sock_wait_established( &s, sock_delay,NULL, &status);
// sock_puts( &s, inet_ntoa(buffer,gethostid()));
// sock_puts( &s, user );
// sock_wait_input( &s, sock_delay, NULL, &status );
// sock_gets( &s, buffer, sizeof( buffer ));
/* we are connected */
while ( 1 ) {
// if (sock_dataready( &s )) {
// sock_gets( &s, rbuffer, sizeof( rbuffer ));
// add_msg( remoteuser, rbuffer );
// sock_read( &s, inbuf, 5140 );
// }
*(unsigned int*)outbuf = (unsigned int)512;
outbuf = 1;outbuf = 2;
sock_write( &s, outbuf,514 );
delay(30);
printf("Out data Over \n"

;
if( kbhit() )
break;
}
exit( 0 );
return (0); /* not reached */
}