Code Monkey home page Code Monkey logo

godsharp.socket's People

Contributors

seayxu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

godsharp.socket's Issues

I recive clone message after disconnect and reconnect

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

Accept fuction causes server shut down

I use GodSharp.SocketServerSample andGodSharp.SocketClientSapmle to test the server stability.
I create about 500 ~ 2000 client to connect/disconnect SocketServer. The server will shut down when acceptfun throw an ex;

image

udp服务器怎么用?

大佬好,能不能提供一个udp服务器用法,研究了半天,没研究明白,谢谢

Problem with Client?

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

what will happened if a client end it's connection and reconnect

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 .

message gets cut. when more then 32k bytes sent

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.NetListener1.ReceivedCallback(IAsyncResult result)

how can the server send message to client ?

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

TCP Sample crash when the client connect to a non-open server

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
image

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

[Request] TLS support

Is there any possibility of adding support for TLS on TCP for both client and server? Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.