View previous topic :: View next topic
|
Author |
Message |
dejunzhu
Active User
Joined: 08 May 2008 Posts: 390 Location: China
|
|
|
|
Hi, I have a socket program performing client side socket communication with server on my PC .
When i execute it on my virtual mvs machine, it works fine, and it can send message to my PC smoothly .
But when i execute it on the real mvs machine of our shop, error occurred with ERRNO 65.when SOCKET CONNECT command is executed.
I have examined the error code, and i found it doesnt make any sense ,as the program can be run smoothly on my virtual machine ,so ,there should be no ip Configuration problem .furthermore ,I issued PING command against my PC address from the command line of MVS, I can see it works fine .
I wonder if any special configuration required for the Real MVS system to support SOCKET program .
Please advise. THX. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
1. Ping tells you two machines are able to reach each other. This is all that Ping tells you.
2. Is the PC running Windows? Is the Windows on the PC running IIS (or its equivalent)? If not, what have you done to establish server services on the PC? Server services are NOT generally provided for desktops by Microsoft, and you will not be able to connect your mainframe to the PC without some form of IIS (or its equivalent) running.
3. Telling us that it works for some virtual machine is useless -- unless you want to connect your virtual machine to the PC and not your mainframe, in which case you have no issue since the virtual machine is already connected.
4. Any particular set up to use socket connections on your mainframe would have to be established by your site support group. Contact them for assistance. |
|
Back to top |
|
|
dejunzhu
Active User
Joined: 08 May 2008 Posts: 390 Location: China
|
|
|
|
I'm using below java program to listen.
the program is developed on eclipse.
Code: |
import java.io.*;
import java.net.*;
public class server{
ServerSocket providerSocket;
Socket connection = null;
ObjectOutputStream out;
ObjectInputStream in;
String message;
server(){}
void run()
{
try{
//1. creating a server socket
providerSocket = new ServerSocket(2004, 10);
//2. Wait for connection
System.out.println("Waiting for connection");
connection = providerSocket.accept();
System.out.println("Connection received from " + connection.getInetAddress().getHostName());
//3. get Input and Output streams
out = new ObjectOutputStream(connection.getOutputStream());
out.flush();
in = new ObjectInputStream(connection.getInputStream());
sendMessage("Connection successful");
//4. The two parts communicate via the input and output streams
do{
try{
message = (String)in.readObject();
System.out.println(" received message from client>" + message);
if (message.equals("bye"))
sendMessage("bye");
}
catch(ClassNotFoundException classnot){
System.err.println("Data received in unknown format");
}
}while(!message.equals("bye"));
}
catch(IOException ioException){
ioException.printStackTrace();
}
finally{
//4: Closing connection
try{
in.close();
out.close();
providerSocket.close();
}
catch(IOException ioException){
ioException.printStackTrace();
}
}
}
void sendMessage(String msg)
{
try{
out.writeObject(msg);
out.flush();
System.out.println("server>" + msg);
}
catch(IOException ioException){
ioException.printStackTrace();
}
}
public static void main(String args[])
{
server server = new server();
while(true){
server.run();
}
}
} |
|
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
No one gives two hoots what software you used to write your program! All that matters is that it runs on a mainframe. And nothing posted answers any of the points/questions raised by Robert. |
|
Back to top |
|
|
Ed Goodman
Active Member
Joined: 08 Jun 2011 Posts: 556 Location: USA
|
|
|
|
There is a lot of wrong here I think.
Where does your virtual machine run? Is it actually the same environment as the mainframe (most likely not)
When you run PING "from the command line" do you mean in TSO option 6? Is that the same environment from which the socket program is running (probably not)
I know that here, a given CICS (or IMS) region runs as a job on a given "box". We used to call them Logical Partitions (aka LPARs), but that's kind of obsolete. So if I run PING in TSO, then try a socket program in IMS, it's two different "boxes."
Also, you can specify different IP stacks in the start up JCL for the regions. So even the right box can have multiple IP infrastructures.
Now, even on the right box, with the right IP stack, there may be blocks put in place on purpose. You'll hear this called a firewall. Only certain ports are open, and you may have to request that. |
|
Back to top |
|
|
|