This commit is contained in:
Carl-Benedikt Krüger 2011-08-03 14:17:10 +02:00
parent 9fd0cbd57c
commit fd69e3705b

View file

@ -157,7 +157,7 @@ void srv_on_conn(ServerEventArgs* e)
char buff[1024];
kprintf("someone finally connected\n");
shelldebugprint("someone finally connected\n");
// shelldebugprint("someone finally connected\n");
tmp1 = get_clock_tick();
for (i = 0; i < 1024*4*4*4; i++)
@ -166,10 +166,12 @@ void srv_on_conn(ServerEventArgs* e)
err = srv_sendBuffer(&srv,e->ClientID,buff,sizeof(buff));
if ( err < 0)
SHELLDEBUGPRINTF("err: %d", err);
// SHELLDEBUGPRINTF("err: %d", err);
kprintf("err: %d", err);
if (!(i%10))
SHELLDEBUGPRINTF("\r-%d-",i);
// SHELLDEBUGPRINTF("\r-%d-",i);
kprintf("\r-%d-",i);
// Sleep(10);
}
@ -192,7 +194,7 @@ void* server_task(void* e)
srv._OnConnect = srv_on_conn;
shelldebugprint("Server is ready...\n");
// shelldebugprint("Server is ready...\n");
while(1)
sleep(2);
@ -322,17 +324,21 @@ void* client_task(void* e)
cli._OnDisconnect = cli_on_disc;
sleep(5);
SHELLDEBUGPRINTF("Client is ready...\n");
// SHELLDEBUGPRINTF("Client is ready...\n");
SHELLDEBUGPRINTF("Client is ready...\n");
while (err)
{
err = cli_ConnectTo(&cli,"192.168.0.2",5555,0);
SHELLDEBUGPRINTF("retry connect err = %d socket: %d\n",err,cli.sSocket);
err = cli_ConnectTo(&cli,"192.168.0.1",5555,0);
// SHELLDEBUGPRINTF("retry connect err = %d socket: %d\n",err,cli.sSocket);
kprintf("Client is ready...\n");
}
SHELLDEBUGPRINTF("connected\n");
// SHELLDEBUGPRINTF("connected\n");
kprintf("Client is ready...\n");
sleep(1);
err = cli_sendBuffer(&cli,"Hallo Welt",sizeof("Hallo Welt"));
SHELLDEBUGPRINTF("send message err = %d\n",err);
// SHELLDEBUGPRINTF("send message err = %d\n",err);
kprintf("Client is ready...\n");
while(1)
sleep(2);
@ -418,12 +424,12 @@ int test_init(void)
#if defined(CONFIG_LWIP) && defined(CONFIG_ROCKCREEK)
shell_init(RCCE_ue());
// shell_init(RCCE_ue());
sleep(10);
SHELLDEBUGPRINTF("hello World! I AM CORE NO. %d =) \n",RCCE_ue());
// sleep(10);
// SHELLDEBUGPRINTF("hello World! I AM CORE NO. %d =) \n",RCCE_ue());
if (RCCE_ue())
if (!RCCE_ue())
create_kernel_task(NULL,server_task,NULL);
else
create_kernel_task(NULL,client_task,NULL);