Git Product home page Git Product logo

rexxsvr's Introduction

A rexx socket server

A socket server coded in rexx, the server recieve data from client socket, when a whole packet arrived, the server invoke coresponding packet handler, after the packet handler proccessed the packet, the server send the result to client socket.

Code organization

socksvr.rexx: socket server coded in rexx, the main logic of the server.

strsvr.jcl: jcl to run the server as a batch job in mainframe.

config.ini: configuration file to set server parameters and configure packet handler

RXPDSMGT.rexx: packet handler to read a pds member(or sequential dataset) and return the content to client

RXSYSCMD.rexx: packet handler to execute a command and return the result to client

pycli.py: a sample python client to send packet to server and print the result

Installation

  1. use ftp to transfer config.ini, strsvr.jcl, socksvr.rexx, RXPDSMGT.rexx and RXSYSCMD.rexx to a pds in mainframe.
  2. submit strsvr.jcl as a batch job.

Done! the server is ready for use!

Packet format

Request packet

8 bytes packet type + 10 bytes content length + content length bytes of content

packet type is used to decide which packet handler to invoke to process the packet, and the content length is used to decide whether the whole packet is arrived.

Response packet

8 bytes message id + 10 bytes content lenght + content length bytes of content

rule of message id:

  • the first 2 bytes of message id is 'RX'

  • the next 1 bytes represent module, 'S' means socket server main module, 'H' means packet handler.

  • the next 4 bytes represent message number.

  • the next 1 bytes represent message type. 'I' means information, 'W' means warning, 'E' means error.

commonly used message id:

  • RXH0000I: packet proccessed sucessfully

  • RXS0001E: packet handler interface error

  • RXS0002E: packet handler not found

Packet handler configuration

New packet handler can be conveniently added to the server, once new packet handler developped, you can configure as shown below:

  1. edit configuration file, add a line like this: packet_type=paket_handler /* add a new packet handler */

  2. put the new packet handler rexx scripts in the rexx library specified in the jcl

  3. restart the server batch job.

rexxsvr's People

Contributors

zgjhust avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.