Send flaged data ..


 
Thread Tools Search this Thread
Top Forums Programming Send flaged data ..
# 1  
Old 12-30-2006
Send flaged data ..

Hello !

I'm writing a chat program , and I have a curiozity. I'm curently using two ports ( sockets ) for client - server interconections.

One socket is used for ordinary ( normal ) data ( Ex : data on main-chat ) , and the another ( two socket ) is used to send management data : ( Ex : I mean username , password and another management datas. ).

Lets give you an example , to be better understood :

I have one client connected to the server . I send from the client to the server the username and the password. I'm sending those two on the management socket . Why that ?

- client 1 is sending it's username on management port . If I use only one single port , client username could interfere with same ordinary data , and another client could just type something on main-chat and the server say : " Hey , it's a username ! altough it was just an ordinary data ". Because of that I'm using two sockets : one for management ( usernames , etc ) and one for ordinary data.

But I only want to use one socket ( client - server ). How do I MARK management data with some flag ( or I don't know ) for the server to differ it from ordinary data. I only want one port for the connection ( one socket with client - server / server - client ).

Practicaly , I want the server , not to listen with select those two socket ( for every client ) , I want it to listen for marked ( management data ) and non-marked ordinary data . Is it posible , to mark some data , for the server , to realize , is management data , not ordinary data ? ..

I mean an example could be :

-the server listening 2 priority ( or more type of data ).

-on thread one , I'm listening for priority 1 data ( ordinary ) [ it was send with priority 1 flag ) , and on another thread I listen for priority 10 data [ mangement data ].


Is it posibile , and if is , I want some ideas . Thanks ! Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to send data to previous program (pipe)?

Hi, Suppose I have a command:$ cmd1 | cmd2I need to send a message from cmd2 to cmd1 when I receive some a certain message from cmd1. How to do this? I think that I have to know cmd1's PID and then in cmd2 send a message to this PID. How? (24 Replies)
Discussion started by: JackK
24 Replies

2. Shell Programming and Scripting

Send Data to MySQL Table Columns

I have two scripts, each script reads an individual data file and copies specific lines of data and sends to MySQL table. Only difference is, each script sends data to a separate column on the same DB. I want to use one script to populate DB table and have data look horizontal, with no overlapping.... (3 Replies)
Discussion started by: SysAdminRialto
3 Replies

3. Programming

UNIX C Send data to PHP

Helo, i try send data from Unix to PHP. What is the correctly way to do this ? i try: c char command ; sprintf(command , "php import.php %s",my_vars); system(command ); php $my_data = @ $argv; this work, but i am not sure that is the right way. an the special chargers are not in... (1 Reply)
Discussion started by: freaky4552
1 Replies

4. Shell Programming and Scripting

Take Data From a table and send it through mail

Hi can anyone help me in writing a code for taking data from a table and need to send that data through mail using mail -x command.. (3 Replies)
Discussion started by: ginrkf
3 Replies

5. Shell Programming and Scripting

To send a mail when the data in a folder changes

Hi All, i have a folder "fold" which will mostly have a date( like 1/2/2013 -a single date alone .whenever the date changes i shoud get a mail. could someone help me with this. (4 Replies)
Discussion started by: mahesh300182
4 Replies

6. Programming

How can I send data to my C converter?

Hello, I have a directory structure of seismic files that are stored within about 1000 different directories. The directory structure is typically no more than two levels deep, and they are organized by station name and disc name. Each disc name folder contains a text file called 'vdaq.txt' that I... (4 Replies)
Discussion started by: ws6transam
4 Replies

7. Infrastructure Monitoring

Send statistical data via SNMP

I am working on a SunOS 5.10 Generic_142900-03 sun4v sparc SUNW,Netra-T2000 With this command: (Unix based cronjob) tail -1 FSC-xxxxxxxxx.stat | nawk -F, '{print $2}' I want to send the numeric output of this command from a statistical file which is updating constantly via SNMPv2 every 1... (4 Replies)
Discussion started by: thinktank
4 Replies

8. Shell Programming and Scripting

send data with Perl

Hello! I want to sent data (pictures: pic.jpg or textfiles) to a server. The pictures should be stored in \my_pictures\beautiful_images. How can I do it with Perl? I think, that I should start with a socket?? Do you have a tutorial or a site, where I can read about it? I use the IDE Padre /... (1 Reply)
Discussion started by: la_dy82
1 Replies

9. Shell Programming and Scripting

Send data to standard input

Hello, I'm writting a korn script that executes a daemon in a remote server. The problem is that daemon doesn't go background until it receives an enter from the standard input, and it maintains the rsh opened until it get it. I'm looking for the best (efficient and elegant) way to do send the... (3 Replies)
Discussion started by: nefeli
3 Replies

10. Shell Programming and Scripting

Filter data and send email

Need script....We get sar file sa15 with 7 days data which gets appended.. we want filter and parse the outptu such that we should filter only last 48 hours data and then email it to out team. we read -- sar -f sa15 Please help me with the script either by use sar itself or even sar and awk... (10 Replies)
Discussion started by: noorm
10 Replies
Login or Register to Ask a Question