Kcp Perl

Extensions for KCP
Alternatives To Kcp Perl
Select To Compare


Readme

kcp-perl

README in English

[TOC]

1

1.1

kcp-perl
 build.sh        # 
 Changes         # 
 .devcontainer   # VSCode
 Dockerfile.dev  # 
 .gitignore
 .gitmodules
 KCP             # KCPPerl
  Changes     #  KCP.pm 
  KCP.xs      # 
  lib
   KCP
    Test.pm
   KCP.pm
  Makefile.PL
  MANIFEST
  ppport.h
  README
  t           # 
  typemap
 kcp-src         # Git skywind3000/kcp 
 LICENSE
 README.md

1.2

  • cpan``kcp-perl
    • cpan -i KCP
    • cpan -i HOMQYY/KCP-0.04.tar.gz

1.3


2

perl

2.1

  1. cpan
yum install -y cpan
  1. perl-Test-Simple
yum install -y perl-Test-Simple

2.2 Perl

  1. Devel::PPPort
cpan -i Devel::PPPort
  1. Test::More
cpan -i Test::More

3

  • kcp
git submodule init
git submodule update

3.1

./build.sh

3.2

./build.sh configure
./build.sh compile
./build.sh test
./build.sh install

4

  • Shell``man KCP perldoc KCPKCP

  • kcp-perl

    use KCP;
    
    sub output
    {
        my ($data, $user) = @_;
    
        $user->{socket}->send($data, 0);
    }
    
    ...
    
    my $kcp = KCP::new($conv, $user);
    
    $kcp->set_mode("fast")->set_output(\&output);
    
    ...
    
    # scheduled call
    
    $kcp->update($current_millisec);
    
    ...
    
    # to send $data
    
    $kcp->send($data);
    
    ...
    
    # to recv data
    
    $kcp->recv($data, 65536);
    
    # input data of transport
    
    $socket->recv($data, 65536, 0);
    
    $kcp->input($data);
    
    ...
    
Popular Networking Categories

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Perl
Kcp