Sponsored Content
Operating Systems Solaris How to clear network socket port 17005? Post 302738789 by jim mcnamara on Sunday 2nd of December 2012 08:25:01 PM
Old 12-02-2012
The suggestions I have may make it better, however you cannot get rid of some wait states and still have tcp configured correctly. I am assuming it goes to TIME_WAIT.

This is a programming error - which you cannot fix. Most times programs call setsockopt() with SO_REUSEADDR so that if the program is forced to exit then the socket can be reused right away.

What you can do is to check a TCP parameter, especially if you really are waiting one half hour. You should only have to wait 4 minutes or so.
As root:

Code:
ndd -get  /dev/tcp time_wait_interval

You should get a value like 60000 (60 seconds = 60 x 1000 for this parameter).
If it is 60000 the problem lies elsewhere. Or I misunderstood what you asked.
Do NOT go below 60000.

If it is a larger number set it to 60 seconds:
Code:
ndd -set /dev/tcp tcp_time_wait_interval 60000

I am assuming this socket goes into TIME_WAIT, which lasts 2 * MSL (Max segment lifetime), we tune that with the tcp_time_wait_interval. So, I am assuming the TIME_WAIT interval TCP setting is bonked.

If the socket persists in LISTEN (not TIME_WAIT), a thread somewhere still has the socket open. You can find the pid with script below. Issue a kill command (NOT kill -9)
Code:
kill <pid>

, the socket should show TIME_WAIT and be gone in 2 minutes or so.

Run this as root:
Code:
#!/bin/ksh
pids=$(/usr/bin/ps -ef | sed 1d | awk '{print $2}')

if [ $# -eq 0 ]; then
   read ans?"Enter port you would like to know pid for: "
else
   ans=$1
fi

for f in $pids
do
   /usr/proc/bin/pfiles $f 2>/dev/null | /usr/xpg4/bin/grep -q "port: $ans"
   if [ $? -eq 0 ]; then
      echo "Port: $ans is being used by PID:\c $f"      
   fi
done

If this does not work you can consider restarting network services, but this has the almost same effect on users and programs as rebooting.

Get back to us if this doesn't help.
 

10 More Discussions You Might Find Interesting

1. Programming

socket on serial port

Does anyone know if it's possible to send socket by a serial port ? If yes, how can I find on Irix the value of my serial ports to use with this function : serverSockAddr.sin_port = ? Thanks for all responses ! Kintoo (2 Replies)
Discussion started by: kintoo
2 Replies

2. Programming

how to clear/clean mbufs (network buffer space)?

When I worked with client-server (socket) programming, I encountered "the socket error# 10055" which means "No buffer space available". This might be a symptom of one or more applications that didn't return system resources (like memory) properly. Temporary solution was to reboot the machine to... (7 Replies)
Discussion started by: dipti
7 Replies

3. UNIX for Dummies Questions & Answers

Socket programming:One server two port

I want my server socket to listen on two ports in my machine. How do i achieve it? I will have two clients one connecting to 1 port and another to a different port. So my server needs to listen to both. Thanks. (1 Reply)
Discussion started by: abc.working
1 Replies

4. Programming

Clear Serial Port Buffer Using iclear, iflush

Hello, I am having trouble clearing the serial port buffer using the iclear and iflush commands. The code runs without errors being returned, but when I check the buffer again there is still data. The only way I have so far is to read until there is nothing left in the buffer. Shouldn't one... (1 Reply)
Discussion started by: sammy-e
1 Replies

5. IP Networking

Port number of socket returned by accept()

Hi, I typed a few tcp/ip client/server examples from a book and it works - sort of - but I noticed something strange. When I run my server I set it to use port 3001 and the client uses the same port to connect to server. They succeed, but the server prints something that doesn't really make much... (0 Replies)
Discussion started by: idelovski
0 Replies

6. HP-UX

how to clear particular port

Hi Everyone, How to check the status of the particular port and also clear it if it is locked without reboot? Please suggest. Thank you. (6 Replies)
Discussion started by: laxmikant
6 Replies

7. Programming

Using socket to test a TCP port

Hello, I'm trying to write a small c application to test a tcp port. This works fine for the most part but the default timeout on the connect is very long. I have been reading many posts but and it looks like I need to set the socket to be non-blocking and poll for a result. I have been totally... (2 Replies)
Discussion started by: tjones1105
2 Replies

8. Solaris

How to enable Serial port on ILOM, when Network Port is enabled in parallel

Hi Everyone, In my environment, I have few T5220. On the iLOM Management Card, I have both Network and Serial port are cabled, I don't have any issues while I try to connect using Network Management port, but when I try to connect the serial port for the same server which is actually connected... (3 Replies)
Discussion started by: bobby320
3 Replies

9. IP Networking

Get process id and port from the socket

Hello, Please help me in getting the process id and the port number from the socket netstat -Aan|grep -i closed f100050010b133b8 tcp 0 0 *.* *.* CLOSED f1000500119b53b8 tcp4 0 0 *.* *.* ... (3 Replies)
Discussion started by: Vishal_dba
3 Replies

10. AIX

Process on a specified Terminal and Socket Port does not start

Hi, I new to AIX, and I have been using Rocket UniData in it. I had to set up a Process for Data Exchange by assigning a unique Terminal and a Socket Port to that process. I ran the process for the first time and it was successful and after use I stopped the process. Now when I want to run it... (3 Replies)
Discussion started by: BejoyS
3 Replies
ndd(1M)                                                   System Administration Commands                                                   ndd(1M)

NAME
ndd - get and set driver configuration parameters SYNOPSIS
ndd [-set] driver parameter [value] DESCRIPTION
ndd gets and sets selected configuration parameters in some kernel drivers. Currently, ndd only supports the drivers that implement the TCP/IP Internet protocol family. Each driver chooses which parameters to make visible using ndd. Since these parameters are usually tightly coupled to the implementation, they are likely to change from release to release. Some parameters may be read-only. If the -set option is omitted, ndd queries the named driver, retrieves the value associated with the specified parameter, and prints it. If the -set option is given, ndd passes value, which must be specified, down to the named driver which assigns it to the named parameter. By convention, drivers that support ndd also support a special read-only parameter named ``?'' which can be used to list the parameters supported by the driver. EXAMPLES
Example 1: Getting Parameters Supported By The TCP Driver To see which parameters are supported by the TCP driver, use the following command: example% ndd /dev/tcp ? The parameter name ``?'' may need to be escaped with a backslash to prevent its being interpreted as a shell meta character. The following command sets the value of the parameter ip_forwarding in the dual stack IP driver to zero. This disables IPv4 packet forward- ing. example% ndd -set /dev/ip ip_forwarding 0 Similarly, in order to disable IPv6 packet forwarding, the value of parameter ip6_forwarding example% ndd -set /dev/ip ip6_forwarding 0 To view the current IPv4 forwarding table, use the following command: example% ndd /dev/ip ipv4_ire_status To view the current IPv6 forwarding table, use the following command: example% ndd /dev/ip ipv6_ire_status ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
nca(1), ioctl(2), attributes(5), arp(7P), ip(7P), ip6(7P), tcp(7P), udp(7P) NOTES
The parameters supported by each driver may change from release to release. Like programs that read /dev/kmem, user programs or shell scripts that execute ndd should be prepared for parameter names to change. The ioctl() command that ndd uses to communicate with drivers is likely to change in a future release. User programs should avoid making dependencies on it. The meanings of many ndd parameters make sense only if you understand how the driver is implemented. SunOS 5.10 8 Nov 1999 ndd(1M)
All times are GMT -4. The time now is 01:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy