This commit is contained in:
root 2011-06-21 13:27:38 +02:00
parent 5513d5f6cb
commit 3e8b2b1808
2 changed files with 6 additions and 5 deletions

View file

@ -1101,7 +1101,7 @@ static int mmnif_wait(struct netif* netif, uint32_t poll, int budget)
*/
int mmnif_worker(void* e)
{
#ifdef MMNIF_DEUBG
#ifdef DEBUG_MMNIF
DEBUGPRINTF("Waiting for work to do!!!\n");
#endif
while (active)

View file

@ -219,7 +219,7 @@ void* client_task(void* e)
/* fill in the socket structure with host information */
memset(&pin, 0, sizeof(pin));
pin.sin_family = AF_INET;
pin.sin_addr.s_addr = inet_addr("192.168.0.1");
pin.sin_addr.s_addr = inet_addr("192.168.0.2");
pin.sin_port = htons(5001);
/* grab an Internet domain socket */
@ -228,18 +228,19 @@ void* client_task(void* e)
return;
}
kprintf("connecting");
/* connect to PORT on HOST */
if (connect(sd,(struct sockaddr *) &pin, sizeof(pin)) == -1) {
kprintf("connect");
return;
}
kprintf("sending");
/* send a message to the server PORT on machine HOST */
if (send(sd, "HELLO THERE", strlen("HELLO THERE"), 0) == -1) {
kprintf("send");
return;
}
kprintf("recieving");
/* wait for a message to come back from the server */
if (recv(sd, dir, 256, 0) == -1) {
kprintf("recv");
@ -256,7 +257,7 @@ return NULL;
int test_init(void)
{
if (!get_core_no())
if (get_core_no())
create_kernel_task(NULL,server_task,NULL);
else
create_kernel_task(NULL,client_task,NULL);