Sponsored Content
Top Forums Programming How to get IP Address of machine? Post 41881 by DreamWarrior on Thursday 16th of October 2003 10:00:10 AM
Old 10-16-2003
Damn, the inet_ntoa won't work. I want to at least be able to get the IP after a call to accept on the socket.... I'll go searching, unless you all are bored and can help me out. If I find anything, I'll post it up...too bad no one around here as a good TCP for Unix book.

BTW, just out of curiosity, you're in Rockville and using HP-UX machines, any chance you're on an FAA contract?

Last edited by DreamWarrior; 10-16-2003 at 11:09 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Changing Machine IP address

Hopefully someone can help with this. I need the command to change the IP address on a machine (7 Replies)
Discussion started by: kkinnon
7 Replies

2. UNIX for Dummies Questions & Answers

Restricting access to a machine by IP Address

I have a need to allow only certain IP addresses to access a machine running solaris 9. I am not sure how this can be accomplished. Thanks in advance for your help. Patch (2 Replies)
Discussion started by: patch
2 Replies

3. IP Networking

how to retrieve IP address of a machine

hi is there is any command that retrieves the IP address of a machine. Also is there any function in c that does the same. thankx (5 Replies)
Discussion started by: mridula
5 Replies

4. Shell Programming and Scripting

How to get Windows machine's IP address from Unix?

I am using windows Xp. From windows I would connect to my IBM AIX unix machine using telnet client. Is there any command available to view the IP address of Windows machine from Unix? (Note that ifconfig will give unix mahcine's IP address currently logged in.) (3 Replies)
Discussion started by: mvictorvijayan
3 Replies

5. UNIX for Advanced & Expert Users

IP address of machine

Hi i want to know the Ip address of the machine from where i logged into the unix server and made some changes to a file. Can I know the last changes made to a unix file ? (3 Replies)
Discussion started by: harneet2004us
3 Replies

6. UNIX for Dummies Questions & Answers

IP address of Unix machine

Can any one please tell me how to find the IP address of the Unix machine we are in? (9 Replies)
Discussion started by: thoothukudiking
9 Replies

7. Solaris

How to get the IP address / Host name of client machine

Hi How to get the IP address / Host name of a particular user connected to Unix Server. For example: If used 'DevUser1' is connected to Unix server. I need to find out from which PC this connection has been made. How can this be achieved? Thanks (6 Replies)
Discussion started by: MVL
6 Replies

8. UNIX for Dummies Questions & Answers

Static IP address for solaris 10 virtual machine

Hi All I am having a solaris 10 virtual machine on vista (using vmware 7) laptop. Now i want to access virtual machine from vista using putty. Problem is that i insalled the solaris machine as dhcp. and whenever i connect to internet or reboot my system the IP address of solaris... (1 Reply)
Discussion started by: ankurk
1 Replies

9. Solaris

i want to set ip address to a virtual machine

hi all i want to set ip address to a vitrual machine i am using following command. but it is not ifconfig -a command output. what is wrong i dont know bash# ifconfig interfacename plumb bash# ifconfig interfacename auto-dhcp Please use code tags next time for your code and data. (4 Replies)
Discussion started by: nikhil kasar
4 Replies

10. Programming

I.p address of machine

i m writing a program which finds the i.p address of the machine. but it just prints out the first three character of the ifconfig output but i want to just print my i.p address lik 10.0.0.222 which is in second line after inet addr: code : #include<iostream> #include<cstdlib> using... (1 Reply)
Discussion started by: console
1 Replies
LISTEN(2)						      BSD System Calls Manual							 LISTEN(2)

NAME
listen -- listen for connections on a socket LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <sys/types.h> #include <sys/socket.h> int listen(int s, int backlog); DESCRIPTION
To accept connections, a socket is first created with socket(2), a willingness to accept incoming connections and a queue limit for incoming connections are specified with listen(), and then the connections are accepted with accept(2). The listen() system call applies only to sockets of type SOCK_STREAM or SOCK_SEQPACKET. The backlog argument defines the maximum length the queue of pending connections may grow to. The real maximum queue length will be 1.5 times more than the value specified in the backlog argument. A subsequent listen() system call on the listening socket allows the caller to change the maximum queue length using a new backlog argument. If a connection request arrives with the queue full the client may receive an error with an indication of ECONNREFUSED, or, in the case of TCP, the connection will be silently dropped. Current queue lengths of listening sockets can be queried using netstat(1) command. Note that before FreeBSD 4.5 and the introduction of the syncache, the backlog argument also determined the length of the incomplete connec- tion queue, which held TCP sockets in the process of completing TCP's 3-way handshake. These incomplete connections are now held entirely in the syncache, which is unaffected by queue lengths. Inflated backlog values to help handle denial of service attacks are no longer neces- sary. The sysctl(3) MIB variable kern.ipc.soacceptqueue specifies a hard limit on backlog; if a value greater than kern.ipc.soacceptqueue or less than zero is specified, backlog is silently forced to kern.ipc.soacceptqueue. INTERACTION WITH ACCEPT FILTERS
When accept filtering is used on a socket, a second queue will be used to hold sockets that have connected, but have not yet met their accept filtering criteria. Once the criteria has been met, these sockets will be moved over into the completed connection queue to be accept(2)ed. If this secondary queue is full and a new connection comes in, the oldest socket which has not yet met its accept filter criteria will be terminated. This secondary queue, like the primary listen queue, is sized according to the backlog argument. RETURN VALUES
The listen() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error. ERRORS
The listen() system call will fail if: [EBADF] The argument s is not a valid descriptor. [EDESTADDRREQ] The socket is not bound to a local address, and the protocol does not support listening on an unbound socket. [EINVAL] The socket is already connected, or in the process of being connected. [ENOTSOCK] The argument s is not a socket. [EOPNOTSUPP] The socket is not of a type that supports the operation listen(). SEE ALSO
netstat(1), accept(2), connect(2), socket(2), sysctl(3), sysctl(8), accept_filter(9) HISTORY
The listen() system call appeared in 4.2BSD. The ability to configure the maximum backlog at run-time, and to use a negative backlog to request the maximum allowable value, was introduced in FreeBSD 2.2. The kern.ipc.somaxconn sysctl(3) has been replaced with kern.ipc.soacceptqueue in FreeBSD 10.0 to prevent confusion about its actual functionality. The original sysctl(3) kern.ipc.somaxconn is still available but hidden from a sysctl(3) -a output so that existing applications and scripts continue to work. BSD
July 15, 2014 BSD
All times are GMT -4. The time now is 03:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy