I've implemented a simple ZeroMQ (0MQ) server and client. It works well when I use them on a machine (local). But when I run the client on one another machine, it doesn't work (it cannot connect to the remote server). I've checked my firewall and it's inactive (in Ubuntu 14.04).
My server code written in java is:
ZMQ.Socket responder = context.socket(ZMQ.REP);
responder.bind("tcp://*:5555");
and the client code:
requester.connect("tcp://ipaddress:5555");
in which "ipaddress" is the IP address of my server.
I've tried also different port numbers.
Please, explain what is the problem and what do you suggest to solve the problem??
Thanks in advance
Related
I am using the example server and client from this website. I have the client on my laptop and the server on my other laptop.
When I run them the server doesn't receive anything. When I run the server and client on the same laptop (doesn't matter which one) the server is able to receive messages. What might be the problem here?
One laptop has W7 and the other W10
I suggest you test multicast connectivity between your two machines using an existing program (without programming anything in Java). Are they in the same subnet?
I haven't used multicast in the last 10 years, but a quick search yields many results.
I have developed a Chat Application for two person, one being server another will be client, using Java Socket Programming. Every thing was fine till this morning. It was working over localhost, local networks as well as On my DDNS ( My Router is configured to forward any traffic on it's port 8888 and 3434 to same port on my IP, which is again Reserved in my router ). But now it works strangely. I ran a server on my laptop at port 8888 I tried to connect the client through my DDNS on port 8888, Client shows it is connected, but Server shows it is disconnected. Client even sends message successfully which does not appear in server.
I want to know what causes such strange behaviour of my application, is this my firewall, because I have used my DDNS a lot in order to debug some issue.
I also want to know what precautions should one take in order to use DDNS in Java Socket.
Additional Informations:
My DDNS in on Dynu
OS: Windows 7 32 bit
Quick Heal Antivirus and firewall (Outdated)
I am adding some pictures:
I have created a simple program , that two computers connect together. I have tested on same computer, no problem.
but When I create ad-hoc network (in Windows 8 for server and 7 for client).
One computer is a server, it run successfully
but in client i received this error :
exception in thread main java.rmi. connectioexception : exception creating connecting to java.net.socketexceptionn: network is unreachable connect
please help me :)
The network condition needs to be the same when you execute the client as it was when the server was started: specifically, the server must still have the same IP address, which must still be reachable from the client. RMI does not work with dynamic networks.
I'm trying to write a client/server application with the server side being hosted on an Amazon EC2 server running Ubuntu. The server works locally, but I can't seem to get it to work on the EC2. I can tell that it's opening a port, as it's supposed to, by using netstat. However, every time I try to connect, the Client program catches an IOException.
The way I'm getting the IP address of the server is from the Public DNS address given by Amazon. I'm assuming that if Amazon gives you ec2-XX-XXX-XXX-XXX.us-west-2.compute.amazonaws.com then XX.XXX.XXX.XXX is the public IP address. Is this correct? Or am I doing something wrong?
Any help is appreciated!
I am trying to connect to a virtual machine using sockets in Java. I have my client and server applications working with no issues on localhost. When I run the Server code and try to connect from a separate machine with the IP address and port number, my client connection times out.
Here is a link to my virtual machine network settings page https://wiki.redbrick.dcu.ie/mw/RBVM_Networking
Do I need to specify any particular parameters in Java to make my server accept connections? Is this an issue I have to take up with the VM network admins?
Any suggestions would be appreciated !
p.s I am running ubuntu server and can access phpmyadmin remotely with no problems.
Edit
I have run nmap and the port I am using for the server side application shows up as open.
My provider was blocking all but a select few ports, got a list of open ones and now it works. derp!