How to delete a socket in the file system
How to delete a socket in the file system
- Subject: How to delete a socket in the file system
- From: Andrea -XFox- Govoni <email@hidden>
- Date: Thu, 08 Jul 2004 01:58:14 +0200
Hi all,
I need to work with BSD sockets but I have a problem with the bind()
system call.
In my code I make a bind() call as follows:
bind(listen_socket, (struct sockaddr *)&mio_ind, sizeof(struct sockaddr);
where listen_socket is an integer returned by socket() and mio_ind is a
sockaddr_in struct.
When I want quit I call "close(listen_socket);" but, according with the
bind() man page, I have also to unlink the socket created in the file
system with bind().
From bind() man page:
"Binding a name in the UNIX domain creates a socket in the file system
that must be deleted by the caller when it is no longer needed (using
unlink(2))."
The problem is that unlink() requires a file system path as argument,
and I don't know the path of the socket created by bind().
How should I call unlink?
I'm on Mac OS X 10.3.4.
--
Andrea "XFox" Govoni
ICQ UIN: 43488185
AIM/iChat: email@hidden
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.