• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How to delete a socket in the file system
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: How to delete a socket in the file system
      • From: Chaz McGarvey <email@hidden>
  • Prev by Date: Re: What's URL are you showing
  • Next by Date: Re: How to delete a socket in the file system
  • Previous by thread: Re: What's URL are you showing
  • Next by thread: Re: How to delete a socket in the file system
  • Index(es):
    • Date
    • Thread