Click here to Skip to main content
15,889,342 members
Home / Discussions / Java
   

Java

 
QuestionAllow applet access to printer - once and for all Pin
Klazen10-Mar-10 11:19
Klazen10-Mar-10 11:19 
AnswerRe: Allow applet access to printer - once and for all Pin
Richard MacCutchan11-Mar-10 1:46
mveRichard MacCutchan11-Mar-10 1:46 
GeneralRe: Allow applet access to printer - once and for all Pin
Klazen12-Mar-10 13:29
Klazen12-Mar-10 13:29 
GeneralRe: Allow applet access to printer - once and for all Pin
Richard MacCutchan12-Mar-10 21:53
mveRichard MacCutchan12-Mar-10 21:53 
QuestionRe: Allow applet access to printer - once and for all Pin
RB Chowdary23-Feb-11 19:51
RB Chowdary23-Feb-11 19:51 
AnswerRe: Allow applet access to printer - once and for all Pin
Andrew Thommo23-Feb-11 23:24
Andrew Thommo23-Feb-11 23:24 
GeneralRe: Allow applet access to printer - once and for all Pin
Marc Schabb4-Jan-12 7:14
Marc Schabb4-Jan-12 7:14 
Questionprevent multiple instances of same server over the network Pin
A-MEN10-Mar-10 6:40
A-MEN10-Mar-10 6:40 
import java.io.*;
import java.net.*;
class EchoServer
{
public static void main(String args[]) throws Exception
{
String clientstr;
String fwdstr;
ServerSocket ssock = new ServerSocket(5678);

while(true)
{
Socket conn = ssock.accept();

BufferedReader inFromClient =new BufferedReader(new InputStreamReader(conn.getInputStream()));
DataOutputStream outToClient =new DataOutputStream(conn.getOutputStream());

clientstr = inFromClient.readLine();
System.out.println("Input from the Client: "+clientstr);
fwdstr = clientstr+ '\n';
outToClient.writeBytes(fwdstr);
}
}
}

this is an echo server..i would like to know how could i make sure that multiple instances of this server is not running elsewhere on the network??? please help..
AnswerCross-post Pin
Kristian Sixhøj10-Mar-10 7:01
Kristian Sixhøj10-Mar-10 7:01 
Questionprintf() help?? Pin
AmbiguousName9-Mar-10 7:49
AmbiguousName9-Mar-10 7:49 
AnswerRe: printf() help?? Pin
Richard MacCutchan9-Mar-10 9:02
mveRichard MacCutchan9-Mar-10 9:02 
AnswerRe: printf() help?? Pin
fuzzix12-Mar-10 7:31
fuzzix12-Mar-10 7:31 
GeneralRe: printf() help?? [modified] Pin
AmbiguousName12-Mar-10 20:20
AmbiguousName12-Mar-10 20:20 
GeneralRe: printf() help?? Pin
Richard MacCutchan12-Mar-10 22:18
mveRichard MacCutchan12-Mar-10 22:18 
GeneralRe: printf() help?? Pin
AmbiguousName12-Mar-10 22:35
AmbiguousName12-Mar-10 22:35 
GeneralRe: printf() help?? Pin
Richard MacCutchan13-Mar-10 0:10
mveRichard MacCutchan13-Mar-10 0:10 
QuestionHow do i catch the exception when it throws OutOfMemory Exception? Pin
Ram Bonala9-Mar-10 0:23
Ram Bonala9-Mar-10 0:23 
AnswerRe: How do i catch the exception when it throws OutOfMemory Exception? Pin
KarstenK9-Mar-10 1:11
mveKarstenK9-Mar-10 1:11 
AnswerRe: How do i catch the exception when it throws OutOfMemory Exception? Pin
Richard MacCutchan9-Mar-10 1:16
mveRichard MacCutchan9-Mar-10 1:16 
GeneralRe: How do i catch the exception when it throws OutOfMemory Exception? Pin
David Skelly9-Mar-10 1:38
David Skelly9-Mar-10 1:38 
GeneralRe: How do i catch the exception when it throws OutOfMemory Exception? Pin
Richard MacCutchan9-Mar-10 2:12
mveRichard MacCutchan9-Mar-10 2:12 
QuestionDiff between j3d and jgl? Pin
002comp8-Mar-10 20:30
002comp8-Mar-10 20:30 
QuestionCustom Design Surface (Hosting a Designer) possible Pin
akamper8-Mar-10 4:10
akamper8-Mar-10 4:10 
AnswerRe: Custom Design Surface (Hosting a Designer) possible Pin
Richard MacCutchan8-Mar-10 21:42
mveRichard MacCutchan8-Mar-10 21:42 
GeneralRe: Custom Design Surface (Hosting a Designer) possible Pin
akamper8-Mar-10 22:33
akamper8-Mar-10 22:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.