Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Looking for a way to emulate network application

  1. #1
    Senior Member
    Join Date
    Jul 2013
    Location
    Europe
    Posts
    666
    Thanks
    0
    Thanked 121 Times in 105 Posts

    Default Looking for a way to emulate network application

    Hi there,

    I am currently testing the networking part of an application. Its a typical Client-Server architecture.
    I want to test whether all the data is correctly synchronized on all clients at any point in time. For this purpose I want to leave the system running with multiple clients.
    The problem is, this is very hard for me to test. I can not create multiple clients on a single machine because every port can only be used once.
    So I have to test with multiple machines, but I dont always have access to all of them and administrating the test across multiple machines is also tedious.

    So I would like to know whether there is some kind of library out there which can be used to emulate the java ServerSocket and Socket classes in a way that it is indenticle to actual network traffic but running on only a single machine.

    Any help would be greatly appreciated.


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Looking for a way to emulate network application

    A number of simple virtual machines?

  3. #3
    Senior Member
    Join Date
    Jul 2013
    Location
    Europe
    Posts
    666
    Thanks
    0
    Thanked 121 Times in 105 Posts

    Default Re: Looking for a way to emulate network application

    Yes, just regular JVM's running a Client-Server application.
    I would just need some kind of library that would emulate TCP Sockets / ServerSockets on a single machine. Possibly with files.
    Performance is not important, just correctness. It needs to be an exact duplicate of regular Socket communication.

  4. #4
    Member jdv's Avatar
    Join Date
    Jul 2014
    Location
    This Land
    Posts
    73
    Thanks
    0
    Thanked 5 Times in 5 Posts

    Default Re: Looking for a way to emulate network application

    Ideally, the client-server communications would use a listen-select model, where the clients are given an ephemeral port after the initial connect to the advertised port. That is, clients should not be using a fixed port, and servers should do all actual communication with clients over a negotiated port that is not the listen port.

    Then you can script as many clients as your memory allows.

    If you can't change the client code, then you you might be able to find or write a multiplexer shim service that brokers the connects between clients and server, handling all the fixed port stuff. I have no idea if such a thing exists, but it would be a neat tool.

    Really, though. Clients should not use a fixed port. Very firewall unfriendly, among other problems.
    Last edited by jdv; August 5th, 2014 at 02:16 PM. Reason: That was weird. Double-post

Similar Threads

  1. Issue while deploying JNLP application in Webspher Application Server.
    By nageshvk in forum What's Wrong With My Code?
    Replies: 1
    Last Post: March 11th, 2014, 09:12 AM
  2. Replies: 2
    Last Post: September 4th, 2012, 03:04 PM
  3. application of monitoring a network in java
    By ola50 in forum Java Networking
    Replies: 0
    Last Post: January 31st, 2012, 12:04 PM
  4. Want to make java application available to all user of Network
    By nicool in forum Java Theory & Questions
    Replies: 5
    Last Post: September 25th, 2011, 07:38 AM