The Artima Developer Community
Sponsored Link

Java Answers Forum
Socket

2 replies on 1 page. Most recent reply: Nov 6, 2003 2:03 PM by s

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
sabab

Posts: 34
Nickname: sabab
Registered: Aug, 2003

Socket Posted: Nov 6, 2003 9:55 AM
Reply to this message Reply
Advertisement
Anybody can help me to do this,
How can i bind the IP 161.6.11.232 with port 80 using the following method,

ServerSocket ss=new ServerSocket(int port, int numberOfClients, InetAddress address)

please help


s

Posts: 23
Nickname: codemonkey
Registered: Nov, 2003

Re: Socket Posted: Nov 6, 2003 1:55 PM
Reply to this message Reply
Be sure that nothing else (like lets say a WEB SERVER)
is running on port 80 of the server this code is running
on...

byte[] ip = {161,6,11,232};
InetAddress address = InetAddress.getByAddress(ip);
int noOfClients = 10; //or whatever
ServerSocket server = new ServerSocket(80,noOfClients,address);
while(true){
Socket s =server.accept();
try{
InputStream in = s.getInputStream();
OutputStream out = s.getOutputStream();

//sabab, i have no idea what you are trying to accomplish in
//your server but this is where you would do the meat
//of your work!
//If you couldnt figure this out,
//I doubt you will be doing anything of value in here...
//I pray that some clueless company is not paying you for
//your "expertise"

}catch(InterruptedException ie){}
}

s

Posts: 23
Nickname: codemonkey
Registered: Nov, 2003

Re: Socket Posted: Nov 6, 2003 2:03 PM
Reply to this message Reply

Flat View: This topic has 2 replies on 1 page
Topic: Client to Browser Communication Previous Topic   Next Topic Topic: JList in JTable

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use