Sorry here is the correct code in that send to is not returning any thing

void ipifSend(VTASK * vtask)
{
    VARIABLE_STR *var = (VARIABLE_STR *) vtask->var;
    /* int ret, i; */
    int ret;

    if (!var->frameLen)
    {
      printf ("\nIPIF: ipifSend: no data to send var->frameLen = 0\n");
        return;
    }

    if (var->ip_addr.family == AF_INET) {
        struct sockaddr_in saddr;
        memset(&saddr, 0, sizeof(saddr));
        saddr.sin_family = AF_INET;
        saddr.sin_addr.s_addr = var->ip_addr.ipv4;

        ret = sendto(var->socket_id, var->outBuff, var->frameLen, 0,
                     (struct sockaddr *) &saddr, sizeof(saddr));
      printf ("\nDKu: IPIF: ipifSend: sendto returned %d \n", ret);
        if (ret > 0)
            return;
    }



On Wed, Oct 28, 2009 at 12:58 PM, Ravi Mishra <[email protected]> wrote:

> here we go:
>
> ////////////////////////////////////////
> Ravi:IPIF:block->data208820968: ^M
> process terminated by watchdog^M
> process terminated by watchdog^M
> Aborted (core dumped)^M
>
> ///////////////////////some part of code//
>
> static void getIpifServParameters(
>                                      MESSAGE * msg,     /* Incoming
> message.           */
>                                      PRIMITIVE primitive,       /* Incoming
> primitive number.  */
>                                      VARIABLE_STR * var)
> {                               /* Variable structure of phys. */
>     IPIF_UP_PARAM_BLOCK *block = (IPIF_UP_PARAM_BLOCK *) msg->parameters;
>
>     switch (primitive) {
>     case ipif_data_send:
>         var->ip_addr = block->ip_addr;
>         var->socket_id = block->sockid;
>         var->frameLen = frameLength(block->data);
>         //printf ("\nDKu:IPIF: getIpifServParameters: pif_data_send
> :var->socket_id = %d\n",var->socket_id);
>         if (!var->frameLen) {
>                 printf ("\nRavi:IPIF: getIpifServParameters: var->frameLen
> = 0\n");
>         }
>         if (var->frameLen > DEFAULT_MAXBUF)
>             woutput("IPIF Error: Frame in block->data too long!\n");
>         else
>             readnBytes(block->data, (BYTE_TYPE *) var->outBuff,
>                        1, var->frameLen);
>
>                 printf ("\nRavi:IPIF:block->data%d: \n",block->data);
>         if (block->data)
>             deleteFrame(&block->data);
>
>         break;
>     case ipif_open_req:
>
> //////////////
>
> here readnByte function return the no of bytes after this suddenly linux
> system watchdog kill the process.
> even if tune the kernal for avoid this thing you can see the above log and
> Ravi printing.
>
> -Ravi
>
> On Wed, Oct 28, 2009 at 12:45 PM, johnmatthews2000 <[email protected]>wrote:
>
>>
>>
>> --- In [email protected] <c-prog%40yahoogroups.com>, Ravi Mishra
>> <ravics...@...> wrote:
>> >
>> > In my code for sending the data i am using sendData system call which is
>> > same as read().
>>
>> Could you show us your code?
>>
>>  
>>
>
>


[Non-text portions of this message have been removed]

Reply via email to