Sponsored Content
Full Discussion: How to encapsulate this ?
Top Forums Programming How to encapsulate this ? Post 302096142 by !_30 on Tuesday 14th of November 2006 06:44:36 AM
Old 11-14-2006
How to encapsulate this ?

Hello !

I have a pretty question.I am working on a client-server chat aplication for Linux shell's.

When a user connect , is receives a window for the username . It has to enter the username, which will be used for future chat and private message ( + other option's ). I'm using socket's for network connection.

The point is , after a user is connect to server socket , the user has to enter a username . The problem here comes like that. Where does the chat server knew , if the username string is an ordinary string , used for chat , or the username string itself ?

I figure to do , some easy encaspulation.When the client connect , and receive username window , the username string is encapsulated with , let's say "***" at the end .

Let's say user !_30 is connected . First the client sends "!_30***" to server , the server dencapsulate those 3 '***' , and knows client username.

The problem here is that , when a user accidentaly send's "***" in main chat , whole sistem is doomed . The server sees "***" at the end .. of ( nothing ) and think's a new user is connected to the server.

How can I make this encapsulation/dencapsulation , transparent to send proces , not altering the string , and be doomed like up ..?

Any idea's , raw socket's ? Because the idea I mention is the only one that came , in that moment in my head .


Any ideas , is apreciate ! Cheer's ! Smilie
 
notificationconf(1)					    BSD General Commands Manual 				       notificationconf(1)

NAME
notificationconf -- configures how aosnotifyd responds to the NSServerNotificationCenter api SYNOPSIS
notificationconf command [command_args] DESCRIPTION
notificationconf is a utility to configure the push notification client functionality. The functionality is accessed by programs using the NSServerNotification api, and this utility configures options for aosnotifyd that are outside the scope of the api. USAGE
You must specify a command to select a specific function to perform. Each command accepts its own arguments. COMMAND SUMMARY
Here are brief descriptions of all the notificationconf commands: setpass hostname username Configures a password and user name in the keychain that aosnotifyd can use to access a notification server. It prompts for the password. removepass hostname Removes the keychain entry for the specified server usessl hostname Forces the client to use an SSL connection to the specified server. The server must have a certificate the client will validate. nossl hostname Sets the client back to the default state of not using an SSL connection for the specified server. createnode hostname nodename username Creates a node on the server to send notifications using. Before a client can subscribe to notifications with a given name, the server must be configured with a node with a matching name. A user name is specified and the tool prompts for a password. This user must have permissions to create notification nodes on the server. FILES
/usr/bin/notificationconf SEE ALSO
aosnotifyd(8) Mac OS X 12 March 2009 Mac OS X
All times are GMT -4. The time now is 09:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy