Toemsel / Network

C# Network Library
https://push-force.dev
GNU Lesser General Public License v3.0
355 stars 65 forks source link

how to get messge from server to client? #50

Closed red-gezi closed 4 years ago

red-gezi commented 4 years ago

when i send a message it will trigger InvokePacketThreadException,what should i do?

red-gezi commented 4 years ago

YH2Z B6~DSQR$74519V2`K

Toemsel commented 4 years ago

Could you please provide a minimalistic project setup and share it online? Then I would be able to debug into the issue. Thanks

Toemsel commented 4 years ago

Working example project:

I did build an example project for your special case.

image

Example Source-Code: #50.zip

Hope that helps you to build up your application.

Why your code doesn't work as expected:

Edit: In your case, you can't use ConnectionEstablished within the client application, since that method will only be triggered if you establish a UDP connection, which isn't the case in your example project.

image

The connection's result will be stored within the out parameter you provide.

image

red-gezi commented 4 years ago

Thanks very much