What's New Our Comics Site Tour Sign Up

 FAQFAQ   SearchSearch   RegisterRegister   ProfileProfile   Log inLog in 

Java Dreams

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Forum Index -> Models Forum -> MartinaWarren.com Discussions
View previous topic :: View next topic  
Author Message
bennie
Rank: Super Veteran


Joined: 23 Dec 2004
Posts: 2043

PostPosted: Sat Dec 09, 2006 3:35 pm    Post subject: Java Dreams Reply with quote


Marilyn meets Martina.. and cancels all her appointments.. Cool


It is extremely rare that a classic beauty meets another classic beauty.
It did happen above !!

Enjoy your weekend Martina !!!
Oh ..and I miss you

--Bennie--
Back to top
View user's profile
MartinaWarren
Official Model


Joined: 22 Dec 2004
Posts: 5031

PostPosted: Mon Dec 11, 2006 8:15 am    Post subject: Reply with quote

Thats so cool Bennie, and i even have a Vodka Cranberry Very Happy

I did enjoy my weekend, i hope you did also Cool
_________________
Martina Warren - Official Website of the 2005 Penthouse Pet of the Year
http://www.martinawarren.com
Back to top
View user's profile
bennie
Rank: Super Veteran


Joined: 23 Dec 2004
Posts: 2043

PostPosted: Mon Dec 11, 2006 9:37 am    Post subject: Reply with quote

MartinaWarren wrote:
Thats so cool Bennie, and i even have a Vodka Cranberry Very Happy

I did enjoy my weekend, i hope you did also Cool


Thx Marfina !!
Glad you liked it !

--Bennie--
Back to top
View user's profile
marcus
Rank: Super Veteran


Joined: 25 Dec 2004
Posts: 1915

PostPosted: Tue Dec 12, 2006 3:38 pm    Post subject: Reply with quote

Bennie, this is what Java dreams look like:

import java.io.*;
import java.net.*;
import java.util.*;
import java.applet.*;

public class ChatServer {

public static void main(String[] args) {
ChatServer cs = new ChatServer();
cs.go();
}

public final static int DEFAULT_PORT = 2000;
public final static int DEFAULT_MAX_BACKLOG = 5;
public final static int DEFAULT_MAX_CONNECTIONS = 20;
public final static String DEFAULT_HOST_FILE = "hosts.txt";
public final static String DEFAULT_SOUND_FILE = "file:gong.au";
public final static String MAGIC = "Yippy Skippy";

private String magic = MAGIC;

private int port = DEFAULT_PORT;
private int backlog = DEFAULT_MAX_BACKLOG;
private int numConnections = 0;
private int maxConnections = DEFAULT_MAX_CONNECTIONS;
private String hostfile = DEFAULT_HOST_FILE;
private String soundfile = DEFAULT_SOUND_FILE;
private List<Connection> connections = null;
private AudioClip connectSound = null;
private Map<String,String> hostToStudentMap = null;

//
// Methods for the Connection class
//

String getMagicPassphrase() {
return magic;
}

String getStudentName(String host) {
return hostToStudentMap.get(host);
}

void sendToAllClients(String message) {
for ( Connection c : connections ) {
c.sendMessage(message);
}
}

void playMagicSound() {
if ( connectSound != null ) {
connectSound.play();
}
}

synchronized void closeConnection(Connection connection) {
connections.remove(connection);
numConnections--;
notify();
}

//
// Private methods
//

private void go() {
String portString = System.getProperty("port");
if (portString != null) port = Integer.parseInt(portString);
this.port = port;

String backlogString = System.getProperty("backlog");
if (backlogString != null) backlog = Integer.parseInt(backlogString);

String hostFileString = System.getProperty("hostfile");
if (hostFileString != null) hostfile = hostFileString;

String soundFileString = System.getProperty("soundfile");
if (soundFileString != null) soundfile = soundFileString;

String magicString = System.getProperty("magic");
if (magicString != null) magic = magicString;

String connections = System.getProperty("connections");
if (connections != null) maxConnections = Integer.parseInt(connections);

this.connections = new ArrayList<Connection>(maxConnections);
this.hostToStudentMap = new HashMap<String,String>(15);

System.out.println("Server settings:\n\tPort="+port+"\n\tMax Backlog="+
backlog+"\n\tMax Connections="+maxConnections+
"\n\tHost File="+hostfile+"\n\tSound File="+soundfile);

createHostList();

try {
URL sound = new URL(soundfile);
connectSound = Applet.newAudioClip(sound);
} catch(Exception e) {
e.printStackTrace();
}

// Begin the processing cycle
processRequests();
}

private void createHostList() {
File hostFile = new File(hostfile);
try {
System.out.println("Attempting to read hostfile hosts.txt: ");
FileInputStream fis = new FileInputStream(hostFile);
InputStreamReader isr = new InputStreamReader(fis);
BufferedReader br = new BufferedReader(isr);
String aLine = null;
while((aLine = br.readLine()) != null) {
int spaceIndex = aLine.indexOf(' ');
if (spaceIndex == -1) {
System.out.println("Invalid line in host file: "+aLine);
continue;
}
String host = aLine.substring(0,spaceIndex);
String student = aLine.substring(spaceIndex+1);
System.out.println("Read: "+student+"@"+host);
hostToStudentMap.put(host,student);
}
} catch(Exception e) {
e.printStackTrace();
}
}

private void processRequests() {
ServerSocket serverSocket = null;
Socket communicationSocket;

try {
System.out.println("Attempting to start server...");
serverSocket = new ServerSocket(port,backlog);
} catch (IOException e) {
System.out.println("Error starting server: Could not open port "+port);
e.printStackTrace();
System.exit(-1);
}
System.out.println ("Started server on port "+port);

// Run the listen/accept loop forever
while (true) {
try {
// Wait here and listen for a connection
communicationSocket = serverSocket.accept();
handleConnection(communicationSocket);
} catch (Exception e) {
System.out.println("Unable to spawn child socket.");
e.printStackTrace();
}
}
}

private synchronized void handleConnection(Socket connection) {
while (numConnections == maxConnections) {
try {
wait();
} catch(Exception e) {
e.printStackTrace();
}
}
numConnections++;
Connection con = new Connection(this, connection);
Thread t = new Thread(con);
t.start();
connections.add(con);
}
}

Be afraid. Be very afraid Shocked
Back to top
View user's profile
bennie
Rank: Super Veteran


Joined: 23 Dec 2004
Posts: 2043

PostPosted: Wed Dec 13, 2006 12:21 pm    Post subject: Reply with quote

lol Marcus !

..Let's Martna decide which she likes best Wink
She might choose yours ..


Chris Consani is regarded as one of the greatest and most popular artists in modern history. He was born in Ottawa, Canada in 1951.

I read somewhere, in fact I have the neon added picture of Marilyn in my house..hence the inspiration


Some neon added examples:
http://www.memoriesoflove.com/chrisconsani.htm


--Bennie--
Back to top
View user's profile
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Forum Index -> Models Forum -> MartinaWarren.com Discussions All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group