Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

REXX and socket calls.

90 views
Skip to first unread message

Dennis Longnecker

unread,
Mar 20, 2001, 2:49:55 PM3/20/01
to
Does REXX on the S/390 support socket calls?

I received a rexx module, that has part of it below. I was trying to get it
to work under netview, but then wondered if it would work anywhere on the
S/390.

Should the below work?

Thanks,
Dennis Longnecker

Parse Arg Server Command
Parse Var Server Server ":" Port
If Port = "" Then
Port = 25999
/* Load REXX Socket library if not already loaded */
If RxFuncQuery("SockLoadFuncs") Then
Do
Call RxFuncAdd "SockLoadFuncs","rxsock","SockLoadFuncs"
Call SockLoadFuncs
End
/* Resolve server name alias to dotted IP address */
rc = SockGetHostByName(Server, "Host.!")
If rc < 0 Then
Do
Say "Unable to resolve server name:" Server || ":" || Port
Return 1
End
/* Create a TCP socket */
Socket = SockSocket("AF_INET", "SOCK_STREAM", "0")
If Socket < 0 Then
Do
Say "Unable to create socket"
Return 1
End
/* Connect the new socket to the specified server */
Host.!family = "AF_INET"
Host.!port = Port
rc = SockConnect(Socket, "Host.!")

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LIST...@VM.MARIST.EDU with the message: GET TSO-REXX INFO

Keith Bower

unread,
Mar 20, 2001, 3:08:56 PM3/20/01
to
I've done a couple rudimentary REXX execs under TSO using sockets. Just a
couple "one liners" (not literally) to see if I could talk to a DNS and an
SMTP server, so I know the basics work.

-Keith Bower
OS/390 Specialist
P.H.E.A.A.

Bob Stark

unread,
Mar 20, 2001, 7:20:59 PM3/20/01
to
Dennis,

Yes, TSO/E REXX does support TCP/IP socket calls, but using the SOCKET()
function, not the functions that you are using, which probably originated
in IBM's Object REXX for Windows NT or OS/2. The syntax is different, but
most of the function calls map. In fact, the S/390 interface has a number
of calls (GiveSocket, TakeSocket, SocketSet) that do not map back to the
Windows NT version.

You can find the doc for SOCKET() in the TCP/IP documentation: SC31-8516
OS/390 eNetwork Communications Server - Application Programming Interface Guide

Regards,
Bob Stark [ProTech]


Regards,

Bob Stark [ProTech - When you're serious about Systems Management]
www.protechpts.com 800-373-9188 x150

Keith Bower

unread,
Mar 21, 2001, 10:42:02 AM3/21/01
to
Yes, indeed. I was using a Communications Server manual. Our flavor is:


OS/390 SecureWay Communications Server Version 2 Release 8

IP Application Programming Interface Guide
(Chapter 12. REXX Socket Application Programming Interface (API))

Document Number SC31-8516-03

-Keith Bower
OS/390 Specialist
P.H.E.A.A.


Dennis Longnecker
<Dennis.Longnecker@COUR To: TSO-...@VM.MARIST.EDU
TS.WA.GOV> cc:
Sent by: TSO REXX Subject: Re: REXX and socket calls.
Discussion List
<TSO-...@VM.MARIST.EDU
>


03/20/01 07:05 PM
Please respond to TSO
REXX Discussion List


Got any ideas on what S/390 manual documents these socket calls?

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU]On Behalf
Of Keith Bower
Sent: Tuesday, March 20, 2001 11:50 AM
To: TSO-...@VM.MARIST.EDU
Subject: Re: REXX and socket calls.


I've done a couple rudimentary REXX execs under TSO using sockets. Just a
couple "one liners" (not literally) to see if I could talk to a DNS and an
SMTP server, so I know the basics work.

-Keith Bower
OS/390 Specialist
P.H.E.A.A.

----------------------------------------------------------------------

Dennis Longnecker

unread,
Mar 26, 2001, 6:56:13 PM3/26/01
to
Carlos -

Thanks for the code. It was similar to mine, but more error reporting.
However, I am still getting the same error message. The remote side tells
me they are getting a connection, but no data after 30 seconds, so we time
out.

Since we are able to connect, I doubt it is a firewall issue.... Is there
any tracing I can do to verify the correct information is being sent out?

26 Mar 2001 15:32:59 PRILTCP - Inicializando tabela de conversao.
26 Mar 2001 15:32:59 PRILTCP - Tabela de conversao inicializada.
26 Mar 2001 15:33:00 PRILTCP - Initialize OK!
26 Mar 2001 15:33:01 PRILTCP - Socket OK!
26 Mar 2001 15:33:01 PRILTCP - My hostname:FOACJES
26 Mar 2001 15:33:01 PRILTCP - My hostaddr:206.194.129.5
26 Mar 2001 15:33:01 PRILTCP - My Sock ID: 1
26 Mar 2001 15:33:01 PRILTCP - Connect OK!
26 Mar 2001 15:33:01 PRILTCP - Remote host:63.121.16.188
26 Mar 2001 15:33:01 PRILTCP - Remote port:25999
26 Mar 2001 15:33:01 PRILTCP - Send OK!
26 Mar 2001 15:33:33 PRILTCP - erro no Recv: 54 ECONNRESET Connection reset
by peer
***

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU]On Behalf

Of Carlos Campos
Sent: Monday, March 26, 2001 2:30 PM
To: TSO-...@VM.MARIST.EDU
Subject: RES: REXX and socket calls.


Dennis,

Send attached a little rexx socket code used in my installation.
I hope you enjoy.

Best Regards,

Carlos Campos
__________________________
Email : ao...@svn.com.br

Dennis Longnecker

unread,
Mar 27, 2001, 11:13:25 AM3/27/01
to

The problem has been resolved. In the command I was sending, I was not
putting in a hex'15' at the end of the command I was sending. As soon as I
did that, everything starting working.

Thanks to all for assisting!

Dennis

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU]On Behalf
Of Carlos Campos
Sent: Tuesday, March 27, 2001 4:46 AM
To: TSO-...@VM.MARIST.EDU
Subject: RES: REXX and socket calls.


Dear Dennis,

This situation looks like a firewall filter, since so that is possible to
block a port in one direction: is permited to send and not to receive ...
Sorry my broken english ...


Best Regards,

Carlos Campos
____________________________________
Email : ao...@uol.com.br
Fone : 55-71-91299661
Fax : 55-71-4511468

-----Mensagem original-----
De: Dennis Longnecker [mailto:Dennis.L...@COURTS.WA.GOV]
Enviada em: segunda-feira, 26 de março de 2001 20:36
Assunto: Re: REXX and socket calls.

0 new messages