[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What's missing/wrong in these test programs?

From: Svante Signell
Subject: Re: What's missing/wrong in these test programs?
Date: Wed, 08 Apr 2015 21:56:36 +0200

On Wed, 2015-04-08 at 10:12 +0200, Svante Signell wrote:
> Hi,
> I'm trying to write test programs for auth_user/server_authenticate (and
> later for proc_user/server_authenticate) and have problems to get them
> right. The attached programs generate the following output:
> ./auth_recv&
> ./auth_send

New try, now with sendmsg/recvmsg.

Terminal 1:
auth_recv.c: Socket file descriptor = 3
auth_recv.c: Receiving via datagram socket
auth_recv.c: msgh.msg_controllen = 16
auth_recv.c: recvmsg() returned 4
auth_recv.c: Received data = 125
auth_recv.c: cmhp->cmsg_len[0] = 16
auth_recv.c: Received file descriptor = 4
auth_recv.c: rendezvous valid

Terminal 2:
auth_send.c: rendezvous port = 125
auth_send.c: Socket file descriptor = 3
auth_send.c: mach_port_insert_right() err = 0
auth_send.c: Sent data = 125
auth_send.c: msgh.msg_controllen = 16
auth_send.c: Sent file descriptor: sfd = 3
auth_send.c: cmhp->cmsg_len = 16
auth_send.c: Sending via datagram socket
auth_send.c: sendmsg() returned 4 bytes

How to send the rendzevous port: as real data or ancillary data?
Should I use the received FD to do what?? The socket is already there.
Using a named connection, i.e. filling in msgh.msg_name and

Attachment: auth_sendmsg.c
Description: Text Data

Attachment: auth_recvmsg.c
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]