• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to create session with other PC

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I want to know how to create session with other machine using java..

i mean suppose i want to login to remote machine using username and password to access the shared file.. how to do that..??

eg: same as what i do when i give IP address in run tab and then username and password..

please help

Amit
 
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The sane way to create a session with another machine is to either write the server ( on one of the machines ) in Java java.net.ServerSocket or use a ready written server such as JGroups or the sample server in the supplied sample docs
which becomes very involved and can be the last time you get anything done, unless getting something done involves learning a few things on a dedicated learning machine.

What are you running when you: eg: same as what i do when i give IP address in run tab and then username and password..

This can get very involved:


That was just something I coded for a discussion of how to come up with a port number, you probably are better off using OO's approach and taking something from mayby Sun sample code or something. I had two different randomizers and the calling convention is different so if you care to get this tested as always selecting a port number conformant to PORT NUMBERS and will not stray from the Dynamic and/or Private Ports are those from 49152 through 65535, then you may be up to writing a simple test case that runs both the server and the client in the same process on a development machine.

For anything that runs across two machines I would reccoment staying within OO practice until you are totally certain you can implement Critical Infrastructure Protection using IPv6

IPv4 is notorious for problematic issues that go beyond the code it's self.



[ Message edited for code formatting ]

[ January 12, 2008: Message edited by: Nicholas Jordan ]
[ January 13, 2008: Message edited by: Nicholas Jordan ]
 
Blood pressure normal? What do I change to get "magnificent"? Maybe this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic