Sponsored Content
Top Forums Programming Is this case is normal when programming in socket? Post 302469364 by DGPickett on Friday 5th of November 2010 04:17:01 PM
Old 11-05-2010
Well, did you write a client or a server or both, and which did you have interactive when you and ^C and the shell killed it?

If you have root, lsof tells you more about sockets.

Using my u_inetd server and a high port, anyone can create a server, even with a shell script. I have not written a listener for a while, since this takes care of my every need.

If you write a client, and it connects, and you kill it, the connection established immediately transitions to another state on most systems.
Code:
$ psm 9090
UID       PID PPID C STIME  TTY TIME COMMAND
dgp     16824    1 0 Jun 14 ?   0:04 u_inetd 9090 http2env
 /home/dgp/myweb
$ (
netstat -an >/tmp/a
( echo hello ; sleep 2 )|telnet localhost 9090 &
sleep 1
netstat -an >/tmp/b
sleep 2
kill -9 $!
netstat -an >/tmp/c
diff /tmp/a /tmp/b |grep 9090
echo ====
diff /tmp/b /tmp/c |grep 9090
)
[1]     12205
Trying...
Connected to localhost.
Escape character is '^]'.
> tcp        0      0  127.0.0.1.9090         127.0.0.1.59702         ESTABLISHED
> tcp        0      0  127.0.0.1.59702        127.0.0.1.9090          ESTABLISHED
====
> tcp        0      0  127.0.0.1.59702        127.0.0.1.9090          TIME_WAIT
< tcp        0      0  127.0.0.1.9090         127.0.0.1.59702         ESTABLISHED
< tcp        0      0  127.0.0.1.59702        127.0.0.1.9090          ESTABLISHED
$

 

10 More Discussions You Might Find Interesting

1. Programming

Socket Programming

Dear Reader, Is there any way to check up socket status other than 'netstatus ' Thanks in advance, (1 Reply)
Discussion started by: joseph_shibu
1 Replies

2. Programming

Socket Programming socket

Hello, I actually try to make client-server program. I'm using SCO OpenServer Release 5.0.0 and when I try to compile my code (by TELNET) I've got this error : I'm just using this simple code : and I get the same error if I use : If someone can help me, Thanks (2 Replies)
Discussion started by: soshell
2 Replies

3. IP Networking

socket programming

Hello Everyone Iam working on tcp/ip programming.with some time interval server has to send data.client has to close the connection and to open the connection between the time interval.this is the scenario when iam closing the connection in client side the connection terminates.how to... (1 Reply)
Discussion started by: sureshvaikuntam
1 Replies

4. UNIX for Advanced & Expert Users

socket programming

Hi, I am trying to connect to more than 60 servers to perform some actions remotely. for this I am using ssh2. But its taking lot of time. Though i am running the command in background, still its taking long time to execute.. Any one let me know can we use sockets instead of ssh2 for... (3 Replies)
Discussion started by: pvamsikr
3 Replies

5. UNIX for Advanced & Expert Users

socket programming

can we send udp message to a destination ip address .. without having an ip address configured in our machine using recvfrom ? (2 Replies)
Discussion started by: Gopi Krishna P
2 Replies

6. Programming

Help with socket programming in C

hi guys i got this code trying to make connection between the server and multi clients but when i do ./server i got message server waiting then when i run ./client it says client 1 nosuch file i dont know whats that should i use any argument plz help how to compile and run and whats the expected... (1 Reply)
Discussion started by: kedah160
1 Replies

7. Programming

help with socket programming in c

i'm doing a simple program in socket programming on c i have server that can handle 2clients in a single machine i'm running ubuntu linux so i got it work but the probelm when clients send a message the server will echo it but i cant distinguish which client send the message client 1 or client... (7 Replies)
Discussion started by: kedah160
7 Replies

8. UNIX for Advanced & Expert Users

Socket programming

my socket program is not working with larger port numbers like more than 60000 , any reason why ? (4 Replies)
Discussion started by: Gopi Krishna P
4 Replies

9. Programming

Socket programming

Hi everyone, I'm new to this forum. I'm working on new project for last few days and this forum already helped me on couple of occasions. I don't have any prior experience with network programming so I'll appreciate any advise given. I'm trying to do the following: 1. open user... (2 Replies)
Discussion started by: _thomas
2 Replies

10. Ubuntu

Socket Programming

HI Can anyone provide me with codes for file transfer server to client or vice versa? Also please explain how to compile those programs in ubuntu terminal as i am totally new to socket programming. Thanks (1 Reply)
Discussion started by: mayhemtrigger
1 Replies
in.timed(1M)						  System Administration Commands					      in.timed(1M)

NAME
in.timed - UDP or TCP time protocol service daemon SYNOPSIS
in.timed FMRI svc:/internet/time:default DESCRIPTION
FMRI stands for Fault Management Resource Identifier. It is used to identify resources managed by the Fault Manager. See fmd(1M) and smf(5). The in.timed service provides the server-side of the time protocol. The time server sends to requestors the time in seconds since midnight, January 1, 1900. The time protocol is available on both TCP and UDP transports through port 37. The in.timed service is an inetd(1M) smf(5) delegated service. The in.timed detects which transport is requested by examining the socket it is passed by the inetd daemon. TCP-based service Once a connection is established, the in.timed sends the time as a 32-bit binary number and closes the connection. Any received data is ignored. UDP-based service The in.timed listens for UDP datagrams. When a datagram is received, the server generates a UDP datagram containing the time as a 32-bit binary number and sends it to the client. Any received data is ignored. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcnsu | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ SEE ALSO
inetd(1M), attributes(5), smf(5) RFC 868 SunOS 5.10 23 Aug 2004 in.timed(1M)
All times are GMT -4. The time now is 05:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy