godsharp / godsharp.socket Goto Github PK
View Code? Open in Web Editor NEWAn easy-to-use .NET socket server and client.
License: MIT License
An easy-to-use .NET socket server and client.
License: MIT License
see topic - may you help me?
Hello. I have some problem here, I see your example and tested your code (Its great but the way) My problem is, Im using winform client, so when the first start send a message to server its fine, console server showme the message. Then, when i closed server and open again to do the same operation, the server show me duplicate message recived. How can I fix the problem?
Also if you provide a guide it will would great. Im learning socket and your code is the best for me.
Im using the lasted nuget at the moment. Thanks
大佬好,能不能提供一个udp服务器用法,研究了半天,没研究明白,谢谢
Looks like the client is not really working? I had to do a couple changes, could you please check it on your end?
66666 :D
I use udpclient as service,it always cause error:10045 not supported.But when i use the old version,it work fine.
I noticed I'm not receiving all the data when it's too large. Is there a way to fix this?
tcp调用同步接收方法 Receive(),对方发送的第一条数据接收不到,第二条数据才能接收到
Thank you for another question.
What will happened if a client end it's connection to server, and reconnect several seconds later?
In my code,client can connect to server successfully, function like client.Connect() ,client.Start() work well,
send("hei") can get an return of 3.
While in Server, OnConnected event will not trigger again, and the Number of server.client is 0, and it can not get hei from client. also can not do anything with client.
what is the wrong with me , thank you .
Sending bigger buffers then 32k byte
usually around byte[32541] ...
ProtoBuf.ProtoException
HResult=0x80131500
Nachricht = Unexpected end-group in source data; this usually means the source data is corrupt
Quelle = protobuf-net
Stapelüberwachung:
at ProtoBuf.ProtoReader.ReadFieldHeader() in C:\code\protobuf-net\src\protobuf-net\ProtoReader.cs:line 672
at ProtoBuf.Meta.TypeModel.DeserializeCore(ProtoReader reader, Type type, Object value, Boolean noAutoCreate) in C:\code\protobuf-net\src\protobuf-net\Meta\TypeModel.cs:line 722
at ProtoBuf.Meta.TypeModel.Deserialize(Stream source, Object value, Type type, SerializationContext context) in C:\code\protobuf-net\src\protobuf-net\Meta\TypeModel.cs:line 590
at ProtoBuf.Serializer.Deserialize[T](Stream source) in C:\code\protobuf-net\src\protobuf-net\Serializer.cs:line 68
at SabberStoneCommon.Contract.DataPacketBuilder.Deserialize(Byte[] buffer) in C:\Users\admin\Source\Repos\SabberStoneGodSharp\SabberStoneCommon\Contract\DataPacket.cs:line 22
at SabberStoneClient.Client.GameClient.OnReceived(NetClientReceivedEventArgs1 c) in C:\Users\admin\Source\Repos\SabberStoneGodSharp\SabberStoneClient\Client\GameClient.cs:line 123 at GodSharp.Sockets.Abstractions.NetListener
1.ReceivedCallback(IAsyncResult result)
as you mentioned , the server can only answer the client's request. what should i do if i want send message from server to client positivly,or brocast to a list of client ?
thank you
Hi Seayxu,
I encounter an error when try to use TCPClientSample to connect my tcp server, but I don't start my server yet. So the sample will show connecction failed.
But, I see the sample go crash !!!
I enter break point debugging, see it crash in TcpConnection:;ConnectCallback
The exception is not really be handled,
(Originally, I think will be handled at TcpConnection::Start . )
I suggest you code should add OnException callback for the exception
catch (SocketException ex)
{
OnException?.Invoke(new NetClientEventArgs<ITcpConnection>(this) { Exception = ex});
}
catch (Exception ex)
{
OnException?.Invoke(new NetClientEventArgs<ITcpConnection>(this) { Exception =ex});
}
or maybe you have better consideration for it. anyway.
Best Regards
Is there any possibility of adding support for TLS on TCP for both client and server? Thank you.
hi
please add onclose for client disconnected.
thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.