Win a copy of Secure Financial Transactions with Ansible, Terraform, and OpenSCAP this week in the Cloud/Virtualization forum!

John Falco

Greenhorn
+ Follow
since Jan 12, 2007
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by John Falco

Sorry about not being more specific. I ran the client app in netbeans because it very nicely will give me the error msgs.

I get connection refused as an error. on the client side

I dont have the a firewall on during the test as well.

Also, i dont get any output from the server side.

This is the connection code:

As you can see the user enters in the IP and socket that i give him.

private void setUpNetworking(){

String IPA;
String OSN;
int SN;



try {
IPA = (jTextField6.getText());
OSN=(jTextField7.getText());
SN = Integer.valueOf(OSN).intValue();


sock = new Socket(IPA, SN);


InputStreamReader streamReader = new InputStreamReader(sock.getInputStream());
reader = new BufferedReader(streamReader);
writer = new PrintWriter(sock.getOutputStream());
jLabel8.setText("Connected to Server");
} catch (IOException ex) {
ex.printStackTrace();
}


}

Thanks for your help
Hello all.
I was hoping the somebody could help me with this. I recently made a chat app with client and server works great on my local network. You know 2 or more clients connect to the server and chat.

However, I would like to beable to use the same app (if I can) so that a friend mine and myself can chat even though he is not connected to my network.

I tried just giving him my server info (IP and socket). I thought he might beable to connect thru his internet connection.

Anyway, it didnt work.....I am new to java and networking/internet connections thru java. So I know I must be missing somthing big.


Can this work and if so how.....

Thanks for all your help