Dear Florian,
This must not block.
If it does, please tell us what TIPC version you are using.

             I am using TIPC -1.7.3 .The call to recv() in the server
program waits for 5 s until the matching send has been executed on the
client, before it returns.

I did not see any fcntl() O_NONBLOCK calls, so this blocks.
             That is true. We are not very concerned about the blocking
nature of the socket in the function "void wait_for_server".

Thanks,
Krishna Chaitanya,


On 7/4/07, [EMAIL PROTECTED] <
[EMAIL PROTECTED]> wrote:

Send tipc-discussion mailing list submissions to
        tipc-discussion@lists.sourceforge.net

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.sourceforge.net/lists/listinfo/tipc-discussion
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of tipc-discussion digest..."


Today's Topics:

   1. Creating a non-blocking TIPC socket (krishna chaitanya)
   2. Re: Creating a non-blocking TIPC socket (Florian Westphal)


----------------------------------------------------------------------

Message: 1
Date: Tue, 3 Jul 2007 16:23:57 +0530
From: "krishna chaitanya" <[EMAIL PROTECTED]>
Subject: [tipc-discussion] Creating a non-blocking TIPC socket
To: tipc-discussion@lists.sourceforge.net
Message-ID:
        <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="iso-8859-1"

Dear all,
            I have attached the simple code where I have made an attempt
at
setting the TIPC socket to work in the non-blocking mode. But, I notice
that
the recv() call is actually waiting for the matching send to be executed.
Is
there a better way of doing the same? Does TIPC support non-blocking
sockets?

Thanks,
Krishna Chaitanya K

--
In the middle of difficulty, lies opportunity
-------------- next part --------------
An HTML attachment was scrubbed...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: client_tipc.c
Type: text/x-csrc
Size: 6401 bytes
Desc: not available
-------------- next part --------------
A non-text attachment was scrubbed...
Name: server_tipc
Type: application/octet-stream
Size: 6106 bytes
Desc: not available

------------------------------

Message: 2
Date: Tue, 3 Jul 2007 13:43:10 +0200
From: Florian Westphal <[EMAIL PROTECTED]>
Subject: Re: [tipc-discussion] Creating a non-blocking TIPC socket
To: tipc-discussion@lists.sourceforge.net
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=us-ascii

krishna chaitanya <[EMAIL PROTECTED]> wrote:
> there a better way of doing the same? Does TIPC support non-blocking
> sockets?

1.7.3:
[..]
recv(5, 0x8055038, 65536, 0)            = -1 EAGAIN
(where 5 is a tipc SOCK_STREAM socket)

> void wait_for_server(struct tipc_name* name,int wait)
[..]
>         int sd = socket (AF_TIPC, SOCK_SEQPACKET,0);
[..]
>         /* Now wait for the subscription to fire: */
>         if (recv(sd,&event,sizeof(event),0) != sizeof(event)){
>                 perror("Failed to receive event");
>                 exit(1);
>         }

I did not see any fcntl() O_NONBLOCK calls, so this blocks.

> int main(int argc, char* argv[], char* dummy[])
[..]
>          if (XSetNonblockSocket (sd) != 0)
[..]
>       if (0 > send(sd,buf,strlen(buf)+1,0)){
>                 perror("Client: Failed to send");
>         }
This must not block.
If it does, please tell us what TIPC version you are using.

Florian



------------------------------

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

------------------------------

_______________________________________________
tipc-discussion mailing list
tipc-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tipc-discussion


End of tipc-discussion Digest, Vol 14, Issue 1
**********************************************




--
In the middle of difficulty, lies opportunity
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
tipc-discussion mailing list
tipc-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tipc-discussion

Reply via email to