not able to send messages with Multicastsocket over my local network - java

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.

Related

How to discover computers in this setup?

I have 3 computers, on the same local network. Computer #1 is a TCP server and computers #2 and #3 are TCP Clients.
When the server starts I am trying to find the IP Addresses of all available clients automatically, so I don't need to enter the IP addresses manually.
I have limited networking experience, can someone please list the ways to do the above?
There are at least 2 ways:
Send a UDP Broadcast message to every computer on the network from server and clients will reply back their IP. This seems not ideal.
Somehow (not sure how) the server set's up a hostname, e.g. "http://localhost//myapp" and clients check every few seconds if the hostname is up and then connect to server. This seems to be implemented in Java RMI.
I am trying to archive my goal using the Java API if possible and avoid writing much code.

Which things should be taken care of in Java Socket Application over DDNS?

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:

ZeroMQ (0MQ), how to connect the client to a remote server?

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

How to "deploy" a server so that it can be reached over the internet?

I recently developed an Android application with which the Android device can communicate with another Android device running the application.
The communication works over sockets, therefore I developed a server which i run on my computer.
Here is my problem:
The communication between the devices over the Server running on my PC works fine, as long as all devices as well as the PC are in the same LAN (connected over the same Router for example).
Now I want to get the server online, so that the Android devices can connect to the "online" server and communicate with each other over the server from anywhere.
I simply have no idea of how to get the server online and running. How can I do that?
The main issue is, that I know about Client/Server communication locally, but have no experience in the "online" sector.
It is more a network problem than a programming one. Your server open a socket and therefore is available to anyone able to reach that socket.
You have to do a redirection on your router. The problem is that your machine doesn't have a public IP, only your router has one. So when your router receive a packet on port 21 for example, it doesn't know what to do with it. You have to configure it to say "the port 21 has to redirected to the local IP XXX"
Also the public IP of your modem/router can change, depending on your ISP. If your have a fixed IP, it won't change, otherwise you will have to install a software like dyndns to have a domain name associated with your IP.

Java socket server make Windows server 2003's network die

I'm developing a socket server/client application by JAVA for server and J2ME for client. Everything was ok when I tested the server in my windows XP. However, then, a serious problem occurred, when I deployed my socket server to server running Windows Server 2003. MY Windows server was lost network connection when my client tried to request a task that require server to send large data. The network connection on server was only saved if I unplugged network cable and plugged it again.
I searched solutions on the Internet and tried many ideas:
- refined code: opened and closed connection carefully in the 'finally' block; assigned the order in opening and closing In-OutStream; increased buffer-size; increased java heap size;
- reset & fixed Winsock of Server.
- declare listening IP for server (Well, my Windows Server has 2 IP: one for Local and other for Internet)
But, unfortunately, everything do not change. My server still die if it must send a large number of data.
Did anyone meet the problem like me? Or Do anyone have any idea for me?
Any help is appreciated.
I'd suggest the problem may not be in your Java program. However, to further troubleshoot, I suggest you create a binary search tree graph. Identify the test which can cut the problem area in half, and repeat.
I've seen one issue a long time ago, where large files couldn't be transfered because a terminator was removed from a 10-Base2 network. You could try transferring large files using other software like FTP, checking to make sure the transfer rate makes sense, etc..
You can use ping to send varying sized packets to the Windows 2003 host. You can run a client locally on the server and see if it has the same problem.
You could have a partially failed NIC, router, or ethernet cable. Such was the case at LAX a few years ago.

Categories

Resources