socket

perlipc doc has sample for doing a socket:

use IO::Socket;
$remote = IO::Socket::INET->new(
				   Proto    => "tcp",
				   PeerAddr => "localhost",
				   PeerPort => "daytime(13)",
			   )
			 or die "cannot connect to daytime port at localhost";
while ( <$remote> ) { print }

but it dies for me.
i see 'daytime' in /etc/services at port 13.
osx 10.1.3
perl 5.6.1

0
rdacker
3/14/2002 8:49:12 PM
perl.macosx 2309 articles. 0 followers. Follow

8 Replies
791 Views

Similar Articles

[PageSpeed] 48

  Just because something's in services, doesn't mean it's running.
  Services indicates "names" for port numbers, e.g., "13 is the daytime
  port".

  Observe:

iago@localhost:~% grep daytime /etc/services
daytime          13/tcp
daytime          13/udp

iago@localhost:~% telnet localhost 13
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused

  Can't connect to port 13 ... therefore, perl shouldn't be able to
  either.

On Thu, 14 Mar 2002, bob ackerman wrote:

> perlipc doc has sample for doing a socket:
> 
> use IO::Socket;
> $remote = IO::Socket::INET->new(
> 				   Proto    => "tcp",
> 				   PeerAddr => "localhost",
> 				   PeerPort => "daytime(13)",
> 			   )
> 			 or die "cannot connect to daytime port at 
> 			 localhost";
> while ( <$remote> ) { print }
> 
> but it dies for me.
> i see 'daytime' in /etc/services at port 13.
> osx 10.1.3
> perl 5.6.1

-- 
Fred Hicks <iago@iago.net>
0
iago
3/14/2002 9:09:59 PM
On Thursday, March 14, 2002, at 12:49  PM, bob ackerman wrote:

> perlipc doc has sample for doing a socket:
>
> use IO::Socket;
> $remote = IO::Socket::INET->new(
> 				   Proto    => "tcp",
> 				   PeerAddr => "localhost",
> 				   PeerPort => "daytime(13)",
> 			   )
> 			 or die "cannot connect to daytime port at localhost";
> while ( <$remote> ) { print }
>
> but it dies for me.
> i see 'daytime' in /etc/services at port 13.
> osx 10.1.3
> perl 5.6.1

Something I've done before, after a fashion.

You might try inserting a more useful error message, something like:

die "IO::Socket::INET $!" unless $remote;

which will likely inform you that localhost is refusing your 
connection on port 13. Don't ask me why (yet), it's not 
important at the moment. Find a remote host whose owner doesn't 
mind you connecting to daytime and try it that way.

also try:

while (defined (<$remote>))

--B

--
"If you actually thought flattery would turn on your Mac, you should
probably read 'Self-Psychotherapy for Dummies' before you continue
with this book. (And if you think that book exists, maybe you 
should check
out 'Gullibility for  Dummies')."   --- Bob Levitus in "MacOS X 
for Dummies"

0
bmcnett
3/14/2002 9:29:45 PM
Incidentally, to get a service such as 'daytime' to run, you can edit the 
/etc/inetd.conf file to remove the leading remark # characters from the 
lines referring to the service of interest. There are two lines in the case 
of daytime; I don't know whether both are actually required. Probably not,
  on reflection. Anyway, you should then issue the command 'killall -HUP 
inetd' to restart the inetd server daemon, and you should be set.

Both these activities require root/admin privileges, of course.

Tim

On Thursday, March 14, 2002, at 09:09  pm, Iago wrote:

>   Just because something's in services, doesn't mean it's running.
>   Services indicates "names" for port numbers, e.g., "13 is the daytime
>   port".
>
>   Observe:
>
> iago@localhost:~% grep daytime /etc/services
> daytime          13/tcp
> daytime          13/udp
>
> iago@localhost:~% telnet localhost 13
> Trying 127.0.0.1...
> telnet: Unable to connect to remote host: Connection refused
>
>   Can't connect to port 13 ... therefore, perl shouldn't be able to
>   either.
>
> On Thu, 14 Mar 2002, bob ackerman wrote:
>
>> perlipc doc has sample for doing a socket:
>>
>> use IO::Socket;
>> $remote = IO::Socket::INET->new(
>> 				   Proto    => "tcp",
>> 				   PeerAddr => "localhost",
>> 				   PeerPort => "daytime(13)",
>> 			   )
>> 			 or die "cannot connect to daytime port at
>> 			 localhost";
>> while ( <$remote> ) { print }
>>
>> but it dies for me.
>> i see 'daytime' in /etc/services at port 13.
>> osx 10.1.3
>> perl 5.6.1
>
> --
> Fred Hicks <iago@iago.net>

0
tfrayner
3/14/2002 9:46:43 PM
yes. i uncommented the daytime tcp line, did a 'kill -HUP 239' and the 
script worked.
i didn't find 'killall' on my system. and 'kill -HUP inetd' didn't work. i 
had to use the pid of inetd.
Thanks. i learning am.

On Thursday, March 14, 2002, at 01:46  PM, Tim Rayner wrote:

> Incidentally, to get a service such as 'daytime' to run, you can edit the 
> /etc/inetd.conf file to remove the leading remark # characters from the 
> lines referring to the service of interest. There are two lines in the 
> case of daytime; I don't know whether both are actually required. 
> Probably not,
>  on reflection. Anyway, you should then issue the command 'killall -HUP 
> inetd' to restart the inetd server daemon, and you should be set.
>
> Both these activities require root/admin privileges, of course.
>
> Tim
>
> On Thursday, March 14, 2002, at 09:09  pm, Iago wrote:
>
>>   Just because something's in services, doesn't mean it's running.
>>   Services indicates "names" for port numbers, e.g., "13 is the daytime
>>   port".
>>
>>   Observe:
>>
>> iago@localhost:~% grep daytime /etc/services
>> daytime          13/tcp
>> daytime          13/udp
>>
>> iago@localhost:~% telnet localhost 13
>> Trying 127.0.0.1...
>> telnet: Unable to connect to remote host: Connection refused
>>
>>   Can't connect to port 13 ... therefore, perl shouldn't be able to
>>   either.
>>
>> On Thu, 14 Mar 2002, bob ackerman wrote:
>>
>>> perlipc doc has sample for doing a socket:
>>>
>>> use IO::Socket;
>>> $remote = IO::Socket::INET->new(
>>> 				   Proto    => "tcp",
>>> 				   PeerAddr => "localhost",
>>> 				   PeerPort => "daytime(13)",
>>> 			   )
>>> 			 or die "cannot connect to daytime port at
>>> 			 localhost";
>>> while ( <$remote> ) { print }
>>>
>>> but it dies for me.
>>> i see 'daytime' in /etc/services at port 13.
>>> osx 10.1.3
>>> perl 5.6.1
>>
>> --
>> Fred Hicks <iago@iago.net>
>

0
rdacker
3/14/2002 10:45:27 PM
On Thu, Mar 14, 2002 at 02:45:27PM -0800, bob ackerman wrote:
> yes. i uncommented the daytime tcp line, did a 'kill -HUP 239' and the 
> script worked.
> i didn't find 'killall' on my system. and 'kill -HUP inetd' didn't work. i 

killall is a linux abomination, the other option on non linux ssystems
is

sudo kill -HUP `cat /var/run/inetd.pid`

not backticks, not single quotes.

HTH

Michael
> had to use the pid of inetd.
> Thanks. i learning am.
> 
> On Thursday, March 14, 2002, at 01:46  PM, Tim Rayner wrote:
> 
> >Incidentally, to get a service such as 'daytime' to run, you can edit the 
> >/etc/inetd.conf file to remove the leading remark # characters from the 
> >lines referring to the service of interest. There are two lines in the 
> >case of daytime; I don't know whether both are actually required. 
> >Probably not,
> > on reflection. Anyway, you should then issue the command 'killall -HUP 
> >inetd' to restart the inetd server daemon, and you should be set.
> >
> >Both these activities require root/admin privileges, of course.
> >
> >Tim
> >

-- 
Dr Michael A. Maibaum - (W)+1 (415) 561 1682 - (H)+1 (415) 626 6733
<mike@maibaum.org> <URL:http://www.gene-hacker.net/>
0
mike
3/14/2002 10:50:46 PM
On Thu, Mar 14, 2002 at 02:50:46PM -0800, Michael Maibaum wrote:
> On Thu, Mar 14, 2002 at 02:45:27PM -0800, bob ackerman wrote:
> > yes. i uncommented the daytime tcp line, did a 'kill -HUP 239' and the 
> > script worked.
> > i didn't find 'killall' on my system. and 'kill -HUP inetd' didn't work. i 
> 
> killall is a linux abomination, the other option on non linux ssystems
> is
> 
> sudo kill -HUP `cat /var/run/inetd.pid`
> 
> not backticks, not single quotes.
erm note backticks

doh, and while on the subject, I should say GNU abomination..it isn't the
kernels fault
> 
> HTH
> 
> Michael
> > had to use the pid of inetd.
> > Thanks. i learning am.
> > 
> > On Thursday, March 14, 2002, at 01:46  PM, Tim Rayner wrote:
> > 
> > >Incidentally, to get a service such as 'daytime' to run, you can edit the 
> > >/etc/inetd.conf file to remove the leading remark # characters from the 
> > >lines referring to the service of interest. There are two lines in the 
> > >case of daytime; I don't know whether both are actually required. 
> > >Probably not,
> > > on reflection. Anyway, you should then issue the command 'killall -HUP 
> > >inetd' to restart the inetd server daemon, and you should be set.
> > >
> > >Both these activities require root/admin privileges, of course.
> > >
> > >Tim
> > >
> 
> -- 
> Dr Michael A. Maibaum - (W)+1 (415) 561 1682 - (H)+1 (415) 626 6733
> <mike@maibaum.org> <URL:http://www.gene-hacker.net/>

-- 
Dr Michael A. Maibaum - (W)+1 (415) 561 1682 - (H)+1 (415) 626 6733
<mike@maibaum.org> <URL:http://www.gene-hacker.net/>
0
mike
3/14/2002 10:52:55 PM
i assume you mean '<those are> backticks, not single quotes.'

On Thursday, March 14, 2002, at 02:50  PM, Michael Maibaum wrote:

> On Thu, Mar 14, 2002 at 02:45:27PM -0800, bob ackerman wrote:
>> yes. i uncommented the daytime tcp line, did a 'kill -HUP 239' and the
>> script worked.
>> i didn't find 'killall' on my system. and 'kill -HUP inetd' didn't work.
>>  i
>
> killall is a linux abomination, the other option on non linux ssystems
> is
>
> sudo kill -HUP `cat /var/run/inetd.pid`
>
> not backticks, not single quotes.
>
> HTH
>
> Michael
>> had to use the pid of inetd.
>> Thanks. i learning am.
>>
>> On Thursday, March 14, 2002, at 01:46  PM, Tim Rayner wrote:
>>
>>> Incidentally, to get a service such as 'daytime' to run, you can edit 
>>> the
>>> /etc/inetd.conf file to remove the leading remark # characters from the
>>> lines referring to the service of interest. There are two lines in the
>>> case of daytime; I don't know whether both are actually required.
>>> Probably not,
>>> on reflection. Anyway, you should then issue the command 'killall -HUP
>>> inetd' to restart the inetd server daemon, and you should be set.
>>>
>>> Both these activities require root/admin privileges, of course.
>>>
>>> Tim
>>>
>
> --
> Dr Michael A. Maibaum - (W)+1 (415) 561 1682 - (H)+1 (415) 626 6733
> <mike@maibaum.org> <URL:http://www.gene-hacker.net/>
>

0
rdacker
3/14/2002 10:58:31 PM
On Thursday, March 14, 2002, at 10:45  pm, bob ackerman wrote:

> yes. i uncommented the daytime tcp line, did a 'kill -HUP 239' and the 
> script worked.
> i didn't find 'killall' on my system. and 'kill -HUP inetd' didn't 
> work. i had to use the pid of inetd.
> Thanks. i learning am.
>
You should find

kill -HUP 1

works - it sends a HUP signal to init, which is the father of all other 
Unix processes, and that then sends the signal to all the others.

0
andy
3/15/2002 11:01:54 AM
Reply:

Similar Artilces:

ext/Socket/Socket.xs
In Socket.xs do I take it that this if (strEQ(name, "MSG_CTRUNC")) #if defined(MSG_TRUNC) || defined(HAS_MSG_CTRUNC) /* might be an enum */ return MSG_CTRUNC; #else goto not_there; #endif should be MSG_CTRUNC? As in: #if defined(MSG_CTRUNC) || defined(HAS_MSG_CTRUNC) /* might be an enum */ Secondly, Socket.pm EXPORTs MSG_URG, but there is no code to generate it in Socket.xs. Was this an oversight somewhere? Nicholas Clark On Sun, Jun 03, 2001 at 03:03:46PM +0100, Nicholas Clark wrote: > In Socket.xs do I take it that this > > if (strEQ(...

Socket to Socket example needed
Does anyone have any configuration examples of how to set up a socket to socket connection. I would appeciate any examples or help anyone can offer. Thanks. Rob McGinness Rutland Regional Medical Center 802-747-6526 rmcginness@rrmc.org I guess that you talk about one AIM module that drives two socket conections. If you try to build such module, you must create two protocol objects within the project. Each protocol object can control its own related objects (frame, port, open, close, etc.) > Does anyone have any configuration examples of how to set > up a socket to socke...

Socket
Dear The Expert, Where can I find complete articles for implementing windows socket in ASP.NET? TIA Winan...

SOCKET
Hi all!!! Can any body help me with some information or docs about Sockets with Power Builder. I'm Working with PB 6.5, but if you have an example in PB 7 I can use it. Now I'm waiting for your help. :-) If you mean three-tier apps, pb has it's own communication objects (transport, connection). If you need something more than that you can use third-party libraries as OLE objects, because you can't work from pob directly with wsock32.dll. <CARRADINE> wrote in message news:1111D847FE7E5A290058E38C85256C75.0058E3D185256C75@webforums... > Hi all!...

Socket
How to get the ipaddress of the client machine using Socket programing,i want to check which r the pc's r connected to the server using vb.net any example will be very helpfull for me thanks in advance PrasantHI think therefore i'mvPras© If you're representing the client as a Socket, this class has a RemoteEndPoint Public property that is of type EndPoint. It encapsulates information about the client. If you're representing the client as a TcpClient, this class has a Protected Client property of type Socket (thus getting to the RemoteEndPoint). Protected meaning you have ...

Sockets
Hi, Is it possible to make a sockets connection with PB6.5? (and how) Thanks in advance, Joe I think this is what you're looking for http://www.teamsybase.com/roy.kiesler/downloads/wininet.zip HTH Arnoud Url: http://www.gloriant.be <Joe> wrote in message news:7F08A3D1FC072C7E003E028585256CC2.003E029385256CC2@webforums... > Hi, > > Is it possible to make a sockets connection with PB6.5? (and how) > > > Thanks in advance, > Joe > WinInet cannot be used for raw socket connection -- it is a simple wrapper for FTP/HTTP/Gop...

Sockets
Does anyone have a suggestion for the easiest and best way to implement sockets in their PB application? Thanks. Shenn Sellers waste.ssellers@co.riverside.ca.us I use freeware OCX (SocketWrench) from Catalyst (www.catalyst.com) Wether it is the best implementation I don't know, but it works for me. Maciek. Shenn Sellers wrote: >Does anyone have a suggestion for the easiest and best way to implement >sockets in their PB application? > >Thanks. > >Shenn Sellers >waste.ssellers@co.riverside.ca.us > > > ...

Sockets
Is it possible to connect to Sybase ASE using Unix domain sockets instead of TCP/IP? Paul Ryland dpar2@cam.ac.uk Davin Yap wrote: > > Is it possible to connect to Sybase ASE using Unix domain sockets > instead of TCP/IP? Not that I know of. Michael -- Michael Peppler -||- Data Migrations Inc. mpeppler@peppler.org -||- http://www.mbay.net/~mpeppler Int. Sybase User Group -||- http://www.isug.com Sybase on Linux mailing list: ase-linux-list@isug.com This is a cryptographically signed message in MIME format. --------------msA85E21818DD8367FB19...

sockets
I'll be simple. I would like Java style Sockets, and Server Sockets. So I can write pb apps to connect/interface/serve directly to other apps based on TCP/IP. Without having to resort to going to third party controls. I would also like my EAServer course not to be posponed for another two months because noone apart from myself wants to go. I've been booked in since Nov last year, and still noone in Sydney wants to go. I've been told that they won't even consider a one-one training session, I think that says quite a lot about why there is a sheer lack of interest i...

socket.
------=_NextPart_000_06EB_01C3BF4D.037FCCC0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I have installed DBI-1.19, and trying to use radiator radius server to = call an MySQL query using DBI. I am getting the following error. My = actual socket is under /etc. I guess this error originates from the DBI. The install was perfect. Deen Wed Dec 10 18:29:47 2003: DEBUG: Handling request with Handler 'Realm=3DDEFAULT' Wed Dec 10 18:29:47 2003: DEBUG: Deleting session for mikem, 203.63.154.1, 1234 Wed Dec 10 ...

About sockets
May be this das not belong hire but I need to know. How can I determent that the packet was realy sent and received? How to disconect socket when there is no function for disconect? Milan, there is no way to see what is transmitted on the socket without doing hardward sniffing. as for closing the connection check out the property SocketReuseLimit. If you set that to 1 then it will close the connection after every call. -- Scott McReynolds Engineering Manager <Milan> wrote in message news:CCF158963E252705001EB0DD85256BEC.001EB0EA85256BEC@webforums... > May be th...

Sockets
PB8.0 W2K What do people use to implement sockets in PB? Nathan I just use the API functions. On Tue, 31 Dec 2002 11:02:34 -0600, NP <tarsi@no-see-evil.binhost.com> wrote: >PB8.0 >W2K > >What do people use to implement sockets in PB? > >Nathan Bruce Armstrong [TeamSybase] http://www.teamsybase.com Not 1 - but 2 new books on developing with PowerBuilder http://www.pb9books.com Which can now be pre-ordered through Amazon.com http://www.amazon.com/exec/obidos/tg/detail/-/0672325004 http://www.amazon.com/exec/obidos/tg/detail/-/0672324997...

Sockets
I'm looking for some of  help/documentation  references to learn TCP/IP Sockets programming in VB.Net.  Can you direct me to some?  The on-line help in Visual Studio helps a little - but am looking for something a little better. jPjP This should get you started: http://www.eggheadcafe.com/articles/20020323.asp Darrell Norton, MVPDarrell Norton's BlogPlease mark this post as answered if it helped you! Have you tried something like this?HTH, rchern.Churned Ajax ToolkitPlease choose "Mark as Answer" for the posts that lead you to a solution....

Web resources about - socket - perl.macosx

AC power plugs and sockets - Wikipedia, the free encyclopedia
AC power plugs and sockets are devices that allow electrically operated equipment to be connected to the primary alternating current (AC) power ...

Ratcheting-Socket-Wrench-22156-480x360 - Flickr - Photo Sharing!
Free Photos – 3/8-Inch Ratcheting Socket Wrench / Chrome Socket Wrench /Repair and Fix Tool kits More photos and details about possible copyright ...

Mitch Robinson lied to Carlton about incident that left him with a broken eye socket
Mitch Robinson lied to Carlton officials when asked why he had suffered a broken eye socket during a scuffle in the early hours of Sunday morning. ...

Brisbane Broncos forward Alex Glenn facing six weeks on sideline with fractured eye socket
Wayne Bennett ranks Brisbane fullbacks as Justin Hodges injury leaves Broncos with fifth choice rookie

Opinion: Will future iPhones lose the 3.5mm headphone socket? What will Apple do instead?
... really not much. If Apple wants to continue the iPhone’s diet, at some point very soon it’s going to have to ditch the 3.5mm headphone socket ...

ASRock Rack Announces EP2C612D24 and 4L: Dual Socket Haswell-EP with 24 DDR4 Slots
... 16GB UDIMMs, this allows for a maximum of 384GB, although moving up to RDIMM, LRDIMMs or 64GB NVDIMMs pushes the max to 1.5TB in a dual socket ...

Windows Server 2016 moving to per core, not per socket, licensing
... until the second half of next year, is going to shake up the way Microsoft licenses its server operating system, moving away from per socket ...

Meet Beam, the Android projector that turns any light bulb socket into an entertainment center
In case you were looking for an out-of-the-box smart projector, then Beam might be worth looking into. The unusual-looking device has just been ...

Cool Chart of the Week: Solar Socket Parity In California, Australia, Germany, Italy, & Netherlands
I forget now how I ran across this chart, but it’s a nice one. It shows that residential solar PV power hit socket parity (aka grid parity) in ...

Dell Aims Four-Socket Server at Modern Database Hardware Needs
... out a greater percentage of the high-end server market, such as in-memory database hardware requirements, Dell today unveiled a four-socket ...

Resources last updated: 12/6/2015 3:42:04 AM