-
-
Notifications
You must be signed in to change notification settings - Fork 351
refactor(ITcpSocketFactory): move socket to extension package #6475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's GuideThis PR refactors the core library by extracting all TCP socket functionality into an extension package, removing related utilities, DI registrations, interfaces, implementations, converters and tests from the core. Class diagram for removed TCP socket typesclassDiagram
class ITcpSocketFactory
class ITcpSocketClient
class ISocketClientProvider
class DefaultTcpSocketFactory
class DefaultTcpSocketClient
class DefaultSocketClientProvider
class ISocketDataConverter
class SocketDataConverter
class SocketDataConverterCollections
class IDataPackageAdapter
class DataPackageAdapter
class IDataPackageHandler
class DataPackageHandlerBase
class DelimiterDataPackageHandler
class FixLengthDataPackageHandler
class ISocketDataPropertyConverter
class SocketDataBoolConverter
class SocketDataByteArrayConverter
class SocketDataDoubleBigEndianConverter
class SocketDataDoubleLittleEndianConverter
class SocketDataEnumConverter
class SocketDataInt16BigEndianConverter
class SocketDataInt16LittleEndianConverter
class SocketDataInt32BigEndianConverter
class SocketDataInt32LittleEndianConverter
class SocketDataInt64BigEndianConverter
class SocketDataInt64LittleEndianConverter
class SocketDataSingleBigEndianConverter
class SocketDataSingleLittleEndianConverter
class SocketDataStringConverter
class SocketDataUInt16BigEndianConverter
class SocketDataUInt16LittleEndianConverter
class SocketDataUInt32BigEndianConverter
class SocketDataUInt32LittleEndianConverter
class SocketDataUInt64BigEndianConverter
class SocketDataUInt64LittleEndianConverter
class SocketClientOptions
class SocketDataPropertyConverterAttribute
class SocketDataTypeConverterAttribute
class ITcpSocketClientExtensions
class TcpSocketExtensions
class SocketDataPropertyExtensions
ITcpSocketFactory <|.. DefaultTcpSocketFactory
ITcpSocketClient <|.. DefaultTcpSocketClient
ISocketClientProvider <|.. DefaultSocketClientProvider
ISocketDataConverter <|.. SocketDataConverter
SocketDataConverterCollections o-- ISocketDataConverter
IDataPackageAdapter <|.. DataPackageAdapter
IDataPackageHandler <|.. DataPackageHandlerBase
DataPackageHandlerBase <|-- DelimiterDataPackageHandler
DataPackageHandlerBase <|-- FixLengthDataPackageHandler
ISocketDataPropertyConverter <|.. SocketDataBoolConverter
ISocketDataPropertyConverter <|.. SocketDataByteArrayConverter
ISocketDataPropertyConverter <|.. SocketDataDoubleBigEndianConverter
ISocketDataPropertyConverter <|.. SocketDataDoubleLittleEndianConverter
ISocketDataPropertyConverter <|.. SocketDataEnumConverter
ISocketDataPropertyConverter <|.. SocketDataInt16BigEndianConverter
ISocketDataPropertyConverter <|.. SocketDataInt16LittleEndianConverter
ISocketDataPropertyConverter <|.. SocketDataInt32BigEndianConverter
ISocketDataPropertyConverter <|.. SocketDataInt32LittleEndianConverter
ISocketDataPropertyConverter <|.. SocketDataInt64BigEndianConverter
ISocketDataPropertyConverter <|.. SocketDataInt64LittleEndianConverter
ISocketDataPropertyConverter <|.. SocketDataSingleBigEndianConverter
ISocketDataPropertyConverter <|.. SocketDataSingleLittleEndianConverter
ISocketDataPropertyConverter <|.. SocketDataStringConverter
ISocketDataPropertyConverter <|.. SocketDataUInt16BigEndianConverter
ISocketDataPropertyConverter <|.. SocketDataUInt16LittleEndianConverter
ISocketDataPropertyConverter <|.. SocketDataUInt32BigEndianConverter
ISocketDataPropertyConverter <|.. SocketDataUInt32LittleEndianConverter
ISocketDataPropertyConverter <|.. SocketDataUInt64BigEndianConverter
ISocketDataPropertyConverter <|.. SocketDataUInt64LittleEndianConverter
Class diagram for Utility class after TCP socket removalclassDiagram
class Utility {
+static IStringLocalizer? CreateLocalizer(Type type)
}
%% Note: ConvertToIPAddress and ConvertToIpEndPoint methods have been removed from Utility
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ArgoZhang - I've reviewed your changes - here's some feedback:
- Consider adding Obsolete shims or aliases for the removed Utility.ConvertToIPAddress/ConvertToIpEndPoint methods so consumers get compile‐time guidance to the new extension package implementations.
- Ensure the new extension package provides an AddTcpSocket (or similarly named) extension method that registers ITcpSocketFactory, SocketDataConverterCollections, and related services with appropriate lifetimes to fully replace the deleted AddSocketDataConverters call.
- Verify that any codepaths or configuration that depended on SocketDataConverterCollections registration now point to the extension package equivalent to prevent missing DI registrations at runtime.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider adding Obsolete shims or aliases for the removed Utility.ConvertToIPAddress/ConvertToIpEndPoint methods so consumers get compile‐time guidance to the new extension package implementations.
- Ensure the new extension package provides an AddTcpSocket (or similarly named) extension method that registers ITcpSocketFactory, SocketDataConverterCollections, and related services with appropriate lifetimes to fully replace the deleted AddSocketDataConverters call.
- Verify that any codepaths or configuration that depended on SocketDataConverterCollections registration now point to the extension package equivalent to prevent missing DI registrations at runtime.
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6475 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 749 714 -35
Lines 32366 31383 -983
Branches 4573 4431 -142
==========================================
- Hits 32366 31383 -983
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Link issues
fixes #6474
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Refactor the core library by relocating TCP socket factory, client implementations, data converters, and utilities to a separate extension package, removing all related code and tests from the main repository
Enhancements: