• 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

problem in name resolution

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi guys...
i am trying out the following client program :-
import java.net.*;
class ChatCseClient
{ public static int clientPort=999;
public static int serverPort=998;
public static int buffer_size=1024;
public static byte buffer[]=new byte[buffer_size];
public static DatagramSocket ds;
public static void TheClient() throws Exception {
InetAddress add=InetAddress.getByName("csehackers.no-ip.biz");

System.out.println(add);
int pos=0;
while(true) {
int c=System.in.read();


switch(c)
{ case -1:System.out.println("client quits ");
return;
case '\r':break;
case '\n' s.send(new DatagramPacket(buffer,pos,add,serverPort));
pos=0;
break;
default: buffer[pos++]=(byte)c ;
}
}
}
public static void main(String[] args) throws Exception
{ ds=new DatagramSocket(clientPort);
TheClient();

}
}
here csehackers.no-ip.biz is a server running on my own computer whose name resolution is done dynamically using no-ips dynamic dns services..now the problem is when i am printing out the inetaddress it is showing me a wrong address that is the name resolution is not happening properly..however when i am typing the same address in my browser the name resolution is happening properly ...help !!!
 
A wop bop a lu bob a womp bam boom. Tutti frutti ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic