Sponsored Content
Top Forums Programming Automatic port selection using C in Linux? Post 302490918 by dsw on Wednesday 26th of January 2011 06:21:14 AM
Old 01-26-2011
What's create()? The irony of including the "e" ... Smilie

Your question is not clear to me - do you wish to discern which port is available on the local box (server) so that you can bind() and listen() on that particular port, *or* do you wish to know on the client which port can be used for bi-directional communication to the server (this port will be chosen automatically if you specify 0 for sin_port, and it will be used for *outgoing* packets unless you are going to listen() on that port).

Probably best to post what you have written so far.
 

9 More Discussions You Might Find Interesting

1. Linux

why is fortran used to port linux to others?

what is the speciality of fortran to be used while porting linux to other language? (1 Reply)
Discussion started by: sravus
1 Replies

2. Linux

Port Linux Driver to Unix

I looking for someone who can help me port a Linux Driver to a OpenBSD( OS X ) Unix Driver. The driver is for a Logic Controls LD9000 USB Customer Display. The currently don't have a driver for the mac operating system, but they do however have one for the Linux OS. So, I am just trying to... (8 Replies)
Discussion started by: ghost1
8 Replies

3. Linux

Linux Port Unreachable

All, I have to servers (NT and REL4). We can access the application on NT from Linux but we cannot access the applications on Linux when accessed from NT. The applicaiton is running on Linux with some IP:Port. When we try to access that application from NT, it says that the port is... (1 Reply)
Discussion started by: The One
1 Replies

4. UNIX for Dummies Questions & Answers

automatic port designation

hi there! can anybody help me on what command will i use for UNIX to generate port numbers? i mean, other than bind? say i want to create a new session, and i dont want to reuse the port that i have used... please help. i would appreciate it so much! with much love, init6_ (2 Replies)
Discussion started by: init6_
2 Replies

5. IP Networking

Setting up port mirroring on LINUX

Hello everyone. I am supposed to configure port mirroring on Linux (the LAN traffic needs to be routed to the other interface and passed a copy to network monitoring software): eth0 - connected to local traffic eth1 - connected to the Internet The machine is running CentOS v4.4 (Server... (1 Reply)
Discussion started by: reminiscent
1 Replies

6. Red Hat

RedHat Linux Automatic Updates

Hi All, we have about 50 RedHat Linux servers (v4.x, 5.x), now we planing to configure those servers to get updates(service packs, security patches...etc) automatically. whats is the best practises to do this. we also have SLES servers and we use Novell's SMT tool to get updates, we... (15 Replies)
Discussion started by: s_linux
15 Replies

7. UNIX for Dummies Questions & Answers

Linux - How to Open a Port

Hi, I would like to open a specific port for use with a bespoke application. Before everyone points me to other threads - I read a few but couldn't find any specific to my problem. Iptables / firewall is disabled SELinux is also disabled I would just like to assign this port to this... (0 Replies)
Discussion started by: mcclunyboy
0 Replies

8. UNIX for Advanced & Expert Users

how to open port in linux

hi experts, I'm using Linux Centos kernel 2.6 Here is the print out of some my port : tcp 0 0 127.0.0.1:10080 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:10081 0.0.0.0:* LISTEN tcp 0 0... (4 Replies)
Discussion started by: justbow
4 Replies

9. Solaris

How to find port number wwn of particular port on dual port HBA,?

please find the below o/p for your reference bash-3.00# fcinfo hba-port HBA Port WWN: 21000024ff295a34 OS Device Name: /dev/cfg/c2 Manufacturer: QLogic Corp. Model: 375-3356-02 Firmware Version: 05.03.02 FCode/BIOS Version: BIOS: 2.02; fcode: 2.01;... (3 Replies)
Discussion started by: sb200
3 Replies
snmp_traprcv(8) 					      System Manager's Manual						   snmp_traprcv(8)

NAME
snmp_traprcv - A program that listens for SNMP trap messages and prints any it receives SYNOPSIS
/usr/sbin/snmp_traprcv [-d] [-tcp] [-p port] OPTIONS
Sends a hexadecimal dump of the received packet to stdout. Specifies that the TCP transport be used instead of the UDP transport. If a connection cannot be established, the program silently receives the trap on the standard transport address (UDP 162). Specifies the port number on the local host on which to listen to messages. The default is 162, the well-known SNMP trap port. DESCRIPTION
The snmp_traprcv program listens on the SNMP Trap port specified in the /etc/services file. If no entry exists in the /etc/services file, the program listens on port 162. If any SNMP trap messages arrive, snmp_traprcv prints them to stdout. The program runs until terminated by typing Ctrl/c. RESTRICTIONS
When using the default or well-known port, you must have root privileges in order to run this program. The program may not be able to bind to the default or specified port if other software on the system is already bound to that port. SEE ALSO
Commands: snmpd(8), snmp_request(8), snmp_trapsnd(8) snmp_traprcv(8)
All times are GMT -4. The time now is 09:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy