Sponsored Content
Top Forums Programming C & TCP question: AF_INET vs AF_UNIX Post 302255589 by Perderabo on Thursday 6th of November 2008 07:06:58 PM
Old 11-06-2008
AF_INET uses the TCP/IP protocol. AF_UNIX creates filesystem objects and it only works between processes on the same host. AF_UNIX is much faster than AF_INET.
 

10 More Discussions You Might Find Interesting

1. Cybersecurity

AF_UNIX versus AF_INET

I'm using AF_INET in sockets for inter process communication on the same machine. Is AF_UNIX better for IPC on the same machine than AF_INET in terms of performance? If so, how much better? I would like to know if there is sample code available to test this. I'm running the program on Solaris. ... (0 Replies)
Discussion started by: ivkumar
0 Replies

2. IP Networking

Unix Scripts & Counting TCP Connections

Here's a question I received on a test recently. I'm new to Linux/Unix so if this is easy, don't kill me. What scripting or tools could you use to count and sort the number of connections from each internal host? I'd appreciate any feedback and resources. "The Cisco PIX firewall provides... (5 Replies)
Discussion started by: daveohr
5 Replies

3. IP Networking

What does 'AF' of AF_INET stand for ?

as title. and how is it different from PF_INET ? also, any one knows sin_family , sin_port , sin_addr ..etc ? why are they called 'sin' ? finally, htons() host to network short , htonl() host to network long , ntohs() network to host short , ntohl() network to host long. why would... (6 Replies)
Discussion started by: trapeze
6 Replies

4. Programming

TCP status question

There is a server and a client,when client send a message to server,server can send a reply to client. The status of server and client is ESTABLISHED.Then I halt the client,I find the server status is CLOSE_WAIT and the client status is FIN_WAIT_2. Many minutes passed,I find the the server status... (1 Reply)
Discussion started by: konvalo
1 Replies

5. Shell Programming and Scripting

perl newbie . &&..programming newbie (question 2)

Hello everyone, I am having to do a lot of perl scripting these days and I am learning a lot. I have this problem I want to move files from a folder and all its sub folders to one parent folder, they are all .gz files.. there is folder1\folder2\*.gz and there are about 50 folders... (1 Reply)
Discussion started by: xytiz
1 Replies

6. Red Hat

How to kill a TCP connection which has status TIME_WAIT & no PID

Hi, I want to kill TCP connections which have status as TIME_WAIT & no PID (as per the output of the "netstat - p" command). Is there any command/utility available to kill connections to a specific port or IP address. The problem is that these connections don't have process ID (see... (4 Replies)
Discussion started by: Davinder31may
4 Replies

7. IP Networking

Wireshark TCP and HTTP question.

Hello all. This is my first post and thank you for your forum. Here is my question. I have a simple setup at home and I was capturing some data with wireshark. Data between a workstation and the web server, requesting a page. Simple enough. Now when I open wireshark, I apply the TCP... (4 Replies)
Discussion started by: squaresphere
4 Replies

8. Shell Programming and Scripting

awk Help: quick and easy question may be: How to use &&

Hi Guru's. I am trying to use to check if $5 is greater than 80 & if not 100, then to print $0 : awk '{ if ($5>80) && if ($5 != 100) print $0} But getting error: >bdf1|sed 's/%//g'|awk '{ if ($5>80) && if ($5 != 100) print $0}' syntax error The source line is 1. The error... (6 Replies)
Discussion started by: rveri
6 Replies

9. Solaris

Too much TCP retransmitted and TCP duplicate on server Oracle Solaris 10

I have problem with oracle solaris 10 running on oracle sparc T4-2 server. Os information: 5.10 Generic_150400-03 sun4v sparc sun4v Output from tcpstat.d script TCP bytes: out outRetrans in inDup inUnorder 6833763 7300 98884 0... (2 Replies)
Discussion started by: insatiable1610
2 Replies

10. Programming

Problem and question with TCP

Hi guys , i write this message for a doubt, a time ago i wrote a client/server program with TCP/IP in Linux. When i tested the program flooding the server with messages of 1024 bytes (Or 1025 bytes i dont remember exactly the number but was more that 1000 bytes) in certain point a message was... (5 Replies)
Discussion started by: Kovalevski
5 Replies
bind(2) 							System Calls Manual							   bind(2)

NAME
bind() - bind an address to a socket SYNOPSIS
AF_CCITT only AF_INET, AF_INET6 and AF_VME_LINK only AF_UNIX only UNIX 03 only (X/Open Sockets) Obsolescent UNIX 95 only (X/Open Sockets) DESCRIPTION
The system call assigns an address to an unbound socket. When a socket is created with it exists in an address space (address family) but has no address assigned. causes the socket whose descriptor is s to become bound to the address specified in the socket address structure pointed to by addr. addrlen must specify the size of the address structure. Since the size of the socket address structure varies between socket address fami- lies, the correct socket address structure should be used with each address family (for example, for AF_INET and AF_VME_LINK, for AF_INET6, and for AF_UNIX). Typically, the function is used to pass this value in the call (for example, The rules used in address binding vary between communication domains. For example, when binding an AF_UNIX socket to a path name (such as an open file having that name is created in the file system. When the bound socket is closed, that file still exists unless it is removed or unlinked. When binding an AF_INET socket or an AF_INET6 socket, sin_port can be a port number or it can be zero. If sin_port is zero, the system assigns an unused port number automatically. AF_VME_LINK Only The system call is used only by servers and not clients. X/Open Sockets Compilation Environment See xopen_networking(7). RETURN VALUE
returns the following values: Successful completion. Failure. is set to indicate the error. ERRORS
If fails, is set to one of the following values. The requested address is protected, and the current user has inadequate permission to access it. (This error can be returned by AF_INET or AF_INET6 only.) The specified address is already in use. The specified address is invalid or not available from the local machine, or for AF_CCITT sockets which use "wild card" addressing, the specified address space overlays the address space of an existing bind. The specified address is not a valid address for the address family of this socket. s is not a valid file descriptor. No addr parameter was specified. addr is not a valid pointer. The socket is already bound to an address, the socket has been shut down, addrlen is a bad value, or an attempt was made to an AF_UNIX socket to an NFS-mounted (remote) name. AF_CCITT: The protocol-ID length is negative or greater than 8, the X.121 address string contains an illegal character, or the X.121 address string is greater than 15 digits long. AF_VME_LINK: An explicit bind can be made only to a well-known port. The x25ifname field name specifies an interface that was shut down, or never initialized, or whose Level 2 protocol indi- cates that the link is not working: Wires might be broken, the interface hoods on the modem are broken, the modem failed, the phone connection failed (this error can be returned by AF_CCITT only), noise interfered with the line for a long period of time. The X.25 Level 2 protocol is down. The X.25 link is not working: Wires might be broken, or connections are loose on the interface hoods at the modem, the modem failed, or noise interfered with the line for an extremely long period of time. No buffer space is available. The cannot complete. No memory is available. The cannot complete. The x25ifname field name specifies a nonexistent interface. (This error can be returned by AF_CCITT only.) s is a valid file descriptor, but it is not a socket. The socket referenced by s does not support address binding. The connection is already bound. (AF_VME_LINK.) OBSOLESCENCE
Currently, the and types are the same size. This is compatible with the UNIX 95 and UNIX 03 profiles. However, in a future release, might be a different size, but that should not adversely affect application behavior in this case. Applications may use now. But applications that need to be portable to the UNIX 95 profile should follow the X/Open specification (see xopen_networking(7)). WARNINGS
Linking binary objects compiled to specification and binary objects compiled to specification to the same executable may result in unex- pected behavior, including application abnormal termination and unexpected socket errors. See xopen_networking(7) for details and remedy. FUTURE DIRECTION
Currently, the default behavior is the however, it might be changed to in a future release. At that time, any behavior that is incompati- ble with might be obsoleted. Applications that conform to the X/Open specification now will avoid migration problems (see xopen_network- ing(7)). AUTHOR
was developed by HP and the University of California, Berkeley. SEE ALSO
connect(2), getsockname(2), listen(2), socket(2), privileges(5), thread_safety(5), inet(7F), IPv6(7P), sctp(7), TCP(7P), UDP(7P), UNIX(7P), xopen_networking(7). STANDARDS CONFORMANCE
bind(2)
All times are GMT -4. The time now is 11:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy