Sponsored Content
Top Forums Programming Write the source code for messenger Post 302094486 by !_30 on Saturday 28th of October 2006 11:27:05 AM
Old 10-28-2006
Thank's guy's for answering . I found your word's useful. I'm getting over the project , everithing seem's more clearly now.
I have a few things to acommodate and everithing seem's to work just fine.

I only have a question for you.I found myself in a situation , I cannot resolve . Maybe I haven't think for the right choice yet , but you can help me ..

I written the server and client code , for some sort of messenger ( mini-version ) , and I don't know ( I may know , but not having the right idea ) , how to implement something. Smilie

I want to make an easy thing.In the source code for the client , I want to implement someting like this :

-when the client want's to transmit data , it gets the buffer ( getstr(buffer) )
-when something arive at the client , some data , it 's print's the string's arived on main window.

I cannot implement this.How can I implement this in C ? I write some sort of code , down :

Code:
int nbytes;
for (;;)
{
if (nbytes=recv(listener,buf,sizeof(buf),0) >0 )
{
        printw("%s\n",buf);
        refresh();
}
else{

getstr(s);
send(listener,s,sterlen(s),0);}

}

The problem , is that this code , is how you see , non-useful and childish.
I want something simple , when I write data , on the client ( getstr(s) ) , to be sent ( to listener -> server ) and when I receive some data ( string's ) , to be printed on the main window.This is all.
The problem is that I cannot make this ..it block's .If I don't enter a string to be sent to the ( listener -> socket server ) , it won't print ( received data ).

Should I use files ?.. or something like that ..

A help , may be needed , if you guy's get the idea , what I want Smilie
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Where can I review the source code?

A very n00b question: After compiling and installing software, where does the original source code reside? I'd like to study the source code of some of the ports I've installed. Thanks! :D (1 Reply)
Discussion started by: Aaron Van
1 Replies

2. Shell Programming and Scripting

write page source to standard output

I'm new to PERL, but I want to take the page source and write it to a file or standard output. I used perl.org as a test website. Here is the script: use strict; use warnings; use LWP::Simple; getprint('http://www.perl.org') or die 'Unable to get page'; exit 0; ... (1 Reply)
Discussion started by: wxornot
1 Replies

3. IP Networking

read/write,write/write lock with smbclient fails

Hi, We have smb client running on two of the linux boxes and smb server on another linux system. During a backup operation which uses smb, read of a file was allowed while write to the same file was going on.Also simultaneous writes to the same file were allowed.Following are the settings in the... (1 Reply)
Discussion started by: swatidas11
1 Replies

4. UNIX for Dummies Questions & Answers

Where can i get unix source code?

Sir please tell me where can i get source code for some unix kernal and shell also. (1 Reply)
Discussion started by: VIPUL15
1 Replies

5. Shell Programming and Scripting

Block of code replacement in Java source code through Unix script

Hi, I want to remove the following code from Source files (or replace the code with empty.) from all the source files in given directory. finally { if (null != hibernateSession && hibernateSession.isOpen()) { //hibernateSession.close(); } } It would be great if the script has... (2 Replies)
Discussion started by: hareeshram
2 Replies

6. Linux

Source code

I need the source code of fedora. plz plz plz help me........... (1 Reply)
Discussion started by: neh
1 Replies

7. Shell Programming and Scripting

Source code compilation

Need assistance in Source code compilation . When installing a software compiling a source code . Whatever the output that prints on the screen i want to log it into a file. How can i see output and store the output to file ./configure make make install Is there other way of seeing output... (5 Replies)
Discussion started by: ajayram_arya
5 Replies

8. UNIX for Dummies Questions & Answers

Source code

hii... i am a biginner....and i have linux source code ,downloaded from some website ,a compressed file on windows and dont know how do compile them..... (4 Replies)
Discussion started by: M K Raju
4 Replies
Mail::SpamAssassin::Plugin::AutoLearnThreshold(3)	User Contributed Perl Documentation	 Mail::SpamAssassin::Plugin::AutoLearnThreshold(3)

NAME
Mail::SpamAssassin::Plugin::AutoLearnThreshold - threshold-based discriminator for Bayes auto-learning SYNOPSIS
loadplugin Mail::SpamAssassin::Plugin::AutoLearnThreshold DESCRIPTION
This plugin implements the threshold-based auto-learning discriminator for SpamAssassin's Bayes subsystem. Auto-learning is a mechanism whereby high-scoring mails (or low-scoring mails, for non-spam) are fed into its learning systems without user intervention, during scanning. Note that certain tests are ignored when determining whether a message should be trained upon: o rules with tflags set to 'learn' (the Bayesian rules) o rules with tflags set to 'userconf' (user configuration) o rules with tflags set to 'noautolearn' Also note that auto-learning occurs using scores from either scoreset 0 or 1, depending on what scoreset is used during message check. It is likely that the message check and auto-learn scores will be different. USER OPTIONS
The following configuration settings are used to control auto-learning: bayes_auto_learn_threshold_nonspam n.nn (default: 0.1) The score threshold below which a mail has to score, to be fed into SpamAssassin's learning systems automatically as a non-spam message. bayes_auto_learn_threshold_spam n.nn (default: 12.0) The score threshold above which a mail has to score, to be fed into SpamAssassin's learning systems automatically as a spam message. Note: SpamAssassin requires at least 3 points from the header, and 3 points from the body to auto-learn as spam. Therefore, the minimum working value for this option is 6. perl v5.12.1 2010-03-16 Mail::SpamAssassin::Plugin::AutoLearnThreshold(3)
All times are GMT -4. The time now is 06:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy