05-12-2007
You are checking the return code from the socket call. Do the same with recv() and send(). If recv fails, the buffer is untouched and you just print whatever garbage was in it.
10 More Discussions You Might Find Interesting
1. Programming
Hi,
I`m trying to do some multicast programming, and i`m looking for a C-function to convert an Interfacename to an IP-address or/and a C-function to convert an Interfaceindex to an IP-address.
I need it for the mcast_set_if(int sockfd, const char *ifname (!), u_int ifindex(!)) function by... (2 Replies)
Discussion started by: darkspace
2 Replies
2. IP Networking
Hey,
I am learning to program a TCP server and managed to get it up and running (I am using Windows 98SE).
I can use the send function to send information to the client and I can use the recv function to ask the user to pass information through, but when I do so it only allows the client to... (1 Reply)
Discussion started by: KrazyGuyPaul
1 Replies
3. UNIX for Dummies Questions & Answers
I am going to purchase Unix Network Programming by Stevens. The only question I have is which edition to buy. The older (early 90's) edition, or the newer (late 90's) edition. I know conventional thinking would point to the latest ( and greatest?), but I wanted to get some feedback from the forum.... (3 Replies)
Discussion started by: dangral
3 Replies
4. Programming
I want to learn Network Programming with C,but I don't know how to start.
Thank you. (2 Replies)
Discussion started by: hubin330
2 Replies
5. Programming
hello,
i am learning networking programming in C from Unix Networking Programing by W. Richards Stevens. i want to compile the source given in this book on windows and linux platform. if somebody know this on windows, pls let me know. and regarding Linux, every time i compile a program on gcc,... (1 Reply)
Discussion started by: vibhory2j
1 Replies
6. Programming
Good day everyone,
Please help if you are interested in.
I need to do a chat client-server program.
Does anyone know where I can get references or sample programs?
Thank you very much for your time
Eric (2 Replies)
Discussion started by: powermind
2 Replies
7. Programming
I have a question regarding the recv syscall.
Suppose I have a client/server and the following exchange of message took place:
Client --> Server using multiple send syscalls one after another immediately:
send "Packet1"
send "Packet2"
send "Packet3"
Server receives in the... (2 Replies)
Discussion started by: heljy
2 Replies
8. Programming
Hi!
I am working on fedora..
trying to execute BSD4.4 client-server program which includes "unp.h" header file...
While executing make command, I got error like,
" expected " , " , " ; ",or ")" in connect_nonb file...ERROR 1 "
I tried to change mode of makefile but I can't get... (4 Replies)
Discussion started by: nisha_vaghela
4 Replies
9. Programming
I have written a client-server program which does some data from a file in server to the client. In this I don't want the client to wait indefinitely if server is not running. For this I am using SELECT system call, in this system call we can specify timings as an argument, which tells the client... (2 Replies)
Discussion started by: naresh046
2 Replies
10. UNIX for Dummies Questions & Answers
How does unix system administration, unix programming, unix network programming differ?
Please help. (0 Replies)
Discussion started by: thulasidharan2k
0 Replies
LEARN ABOUT MOJAVE
mail::address
Mail::Address(3) User Contributed Perl Documentation Mail::Address(3)
NAME
Mail::Address - Parse mail addresses
SYNOPSIS
use Mail::Address;
my @addrs = Mail::Address->parse($line);
foreach $addr (@addrs) {
print $addr->format,"
";
}
DESCRIPTION
"Mail::Address" extracts and manipulates email addresses from a message header. It cannot be used to extract addresses from some random
text. You can use this module to create RFC822 compliant fields.
Although "Mail::Address" is a very popular subject for books, and is used in many applications, it does a very poor job on the more complex
message fields. It does only handle simple address formats (which covers about 95% of what can be found). Problems are with
o no support for address groups, even not with the semi-colon as separator between addresses;
o limited support for escapes in phrases and comments. There are cases where it can get wrong; and
o you have to take care of most escaping when you create an address yourself: "Mail::Address" does not do that for you.
Often requests are made to the maintainers of this code improve this situation, but this is not a good idea, where it will break zillions
of existing applications. If you wish for a fully RFC2822 compliant implementation you may take a look at Mail::Message::Field::Full, part
of MailBox.
METHODS
Constructors
Mail::Address->new(PHRASE, ADDRESS, [ COMMENT ])
Create a new "Mail::Address" object which represents an address with the elements given. In a message these 3 elements would be seen
like:
PHRASE <ADDRESS> (COMMENT)
ADDRESS (COMMENT)
example:
Mail::Address->new("Perl5 Porters", "perl5-porters@africa.nicoh.com");
$obj->parse(LINE)
Parse the given line a return a list of extracted "Mail::Address" objects. The line would normally be one taken from a To,Cc or Bcc
line in a message
example:
my @addr = Mail::Address->parse($line);
Accessors
$obj->address()
Return the address part of the object.
$obj->comment()
Return the comment part of the object
$obj->format([ADDRESSes])
Return a string representing the address in a suitable form to be placed on a "To", "Cc", or "Bcc" line of a message. This method is
called on the first ADDRESS to be used; other specified ADDRESSes will be appended, separated with commas.
$obj->phrase()
Return the phrase part of the object.
Smart accessors
$obj->host()
Return the address excluding the user id and '@'
$obj->name()
Using the information contained within the object attempt to identify what the person or groups name is.
Note: This function tries to be smart with the "phrase" of the email address, which is probably a very bad idea. Consider to use
phrase() itself.
$obj->user()
Return the address excluding the '@' and the mail domain
SEE ALSO
This module is part of the MailTools distribution, http://perl.overmeer.net/mailtools/.
AUTHORS
The MailTools bundle was developed by Graham Barr. Later, Mark Overmeer took over maintenance without commitment to further development.
Mail::Cap by Gisle Aas <aas@oslonett.no>. Mail::Field::AddrList by Peter Orbaek <poe@cit.dk>. Mail::Mailer and Mail::Send by Tim Bunce
<Tim.Bunce@ig.co.uk>. For other contributors see ChangeLog.
LICENSE
Copyrights 1995-2000 Graham Barr <gbarr@pobox.com> and 2001-2007 Mark Overmeer <perl@overmeer.net>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See
http://www.perl.com/perl/misc/Artistic.html
perl v5.18.2 2014-01-05 Mail::Address(3)