Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Kcp/Kcp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public Kcp(uint conv_, IKcpCallback callback, IRentable rentable = null)
{
callbackHandle = callback;
this.rentable = rentable;
buffer = CreateBuffer(BufferNeedSize);
}


Expand Down
10 changes: 7 additions & 3 deletions Kcp/KcpCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,9 @@ protected int BufferNeedSize

#endregion

public ISegmentManager<Segment> SegmentManager { get; set; }
public KcpCore(uint conv_)
public ISegmentManager<TSegment> SegmentManager { get; set; }

public KcpCore(uint conv_, bool initBuffer = true)
{
conv = conv_;

Expand All @@ -308,7 +309,10 @@ public KcpCore(uint conv_)
rmt_wnd = IKCP_WND_RCV;
mtu = IKCP_MTU_DEF;
mss = mtu - IKCP_OVERHEAD;
buffer = CreateBuffer(BufferNeedSize);
if (initBuffer)
{
buffer = CreateBuffer(BufferNeedSize);
}

rx_rto = IKCP_RTO_DEF;
rx_minrto = IKCP_RTO_MIN;
Expand Down