I was some time ago set the task of creating a chat program, and for the most i have succeeded :). I know the socket code that i made works for most servers but a firewall prevents others from seeing it. We have found a host that will let us run the chat server and said there is no firewall but it dont seem to work. The server owner tells me that a cobalt raq4 server behaves slightly different from other servers and that the chat code may have to change. Now to the question, where can i find perl code for a chat server that opens up ports for tcp connection for a client to send to which runs on a cobalt server.
this is the current code i used but doesn't seem to quiet work
use POSIX qw(setsid);
use IO::Socket;
use Socket;
use IO::Select;
$verb = 50; # verbosity for console messages
$main = new IO::Socket::INET (LocalHost => '-not showing the ip here,
+sorry people',
LocalPort => 4448,
Listen => 5,
Proto => 'tcp',
Reuse => 1 ) || die $!;
$zero = chr(0);
$/ = $zero;
$\ = $zero;
$| = 1;
#&daemonize;
# Initialise IO::Select ---------------------------
$handles = new IO::Select->new($main);
print "Starting listening cycle\n" if ($verb > 1);
while(@send_pipe = $handles->can_read) {
.....
}
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.