aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes want to run my swing application on local area network? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "want to run my swing application on local area network?" Watch "want to run my swing application on local area network?" New topic
Author

want to run my swing application on local area network?

Jatin sachdev
Ranch Hand

Joined: Jan 21, 2010
Posts: 57
I want to run my application on my college network.
please help me in this regard

I dont know network programming.I have heard that it requires RMI.

How ???
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42583
    
  65
Swing has nothing to do with RMI. Where do you see the connection to network programming - what does the app do?

And no, network access in a java app does not imply RMI; there are many other ways to do that, like HTTP or raw TCP sockets.


Ping & DNS - my free Android networking tools app
Jatin sachdev
Ranch Hand

Joined: Jan 21, 2010
Posts: 57
I dont know about this.

I only want my swing application to run on LAN. For e.g

I have 2 computers connected through LAN. I want to send something to 2nd computer and second in turn replies back.
Kind of client server in which one sends other responds.......
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42583
    
  65
Yes, Swing apps (like all Java apps) can communicate via TCP sockets over a network. The Java Tutorial can teach you all about that: http://download.oracle.com/javase/tutorial/networking/sockets/index.html
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8963
    
    9

I think RMI is easier to work with than sockets because you don't have to deal with all the low-level details of sockets and protocols.
The RMI tutorial is here.


[How To Ask Questions On JavaRanch]
Jatin sachdev
Ranch Hand

Joined: Jan 21, 2010
Posts: 57
I think RMI is easier to work with than sockets because you don't have to deal with all the low-level details of sockets and protocols.
The RMI tutorial is here.


Thank you Joe.

Please give me one suggestion

Suppose I have 2 set of codes--one is Socket based other is in JSP.
In my college there is a LAN.Every single computer is connected through it.

I want:-
A person on 3rd floor (Client- i.e. Socket) to have access to database on ground floor(Server-i.e ServerSocket).Is it possible ?
Server does not know the IP address of the Client in this case. please tell


Other thing is:
I want my JSP code to be visible to every computer in LAN.How to do that???
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42583
    
  65
Having a JSP implies that there's an HTTP server (with a servlet container) running - in a normal environment that would be visible on the LAN under the IP address of the machine running the server without anything special needing to be done; is it not?
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8963
    
    9

Jatin sachdev wrote:[.
I want:-
A person on 3rd floor (Client- i.e. Socket) to have access to database on ground floor(Server-i.e ServerSocket).Is it possible ?
Server does not know the IP address of the Client in this case. please tell


The details of connecting two comptuers via a network have little to do with the physical location of the server. If they are on the same network (as you indicate) you should be able to connect.
Sockets are persistent two-way connections, so the server does not have to know the IP address of the client.
 
jQuery in Action, 2nd edition
 
subject: want to run my swing application on local area network?