We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › Chat Program with eventually possible encryption
Page Index Toggle Pages: 1
Chat Program with eventually possible encryption (Read 235 times)
Chat Program with eventually possible encryption
Dec 12th, 2008, 11:26pm
 
i found this interesting peice of code on the learning section under libraries on the main site.

import processing.net.*;

int port = 10002;
boolean myServerRunning = true;
int bgColor = 0;
int direction = 1;
int textLine = 60;

Server myServer;

void setup()
{
 size(400, 400);
 textFont(createFont("SanSerif", 16));
 myServer = new Server(this, port); // Starts a myServer on port 10002
 background(0);
}

void mousePressed()
{
 // If the mouse clicked the myServer stops
 myServer.stop();
 myServerRunning = false;
}

void draw()
{
 if (myServerRunning == true)
 {
   text("server", 15, 45);
   Client thisClient = myServer.available();
   if (thisClient != null) {
     if (thisClient.available() > 0) {
       text("mesage from: " + thisClient.ip() + " : " + thisClient.readString(), 15, textLine);
       textLine = textLine + 35;
     }
   }
 }
 else
 {
   text("server", 15, 45);
   text("stopped", 15, 65);
 }
}

it looks like its only the server...but it looks promising. How would i make it so it scrambles the text sent and descrabmles it when it reaches the other person
Page Index Toggle Pages: 1