Comments (7)
Because the server rejects a UDP connection and kills the related TCP connection.
Then the ClientConnectionContainer receives the info that the UDP/TCP is dead and reconnects.
Hence, if you dont allow UDP, you can't use the ClientConnectionContainer. Use the TcpConnection only instead.
Hope that helps
from network.
Thank you for your answer, I will use your suggestion.
from network.
Hum sorry but since i create a tcp connection and not a container on client, packets stopped to be send
client is connected but nothing is send from the client
private void TestClient()
{
var container = ConnectionFactory.CreateTcpConnection("127.0.0.1", 8899, out _);
container.ConnectionEstablished += Established;
}
private void Established(TcpConnection con, UdpConnection arg2)
{
Console.WriteLine($@"{con} Connection established");
con.RegisterPacketHandler<LoginResponse>(OnResponseReceived, this);
con.Send(new LoginRequest("TEST", "TEST"), this);
}
from network.
The event subscriber seems strange with TCP and UDP as a parameter. However, please take a look at the examples:
https://www.indie-dev.at/2016/10/03/client-setup/
or on github
https://github.com/Toemsel/Network/blob/master/Examples/NetworkTestClient/SingleConnectionExample.cs
In order to help you even further, please also post the server code. Thanks
from network.
its a auto generated method with parameter from
The server is exactly the same code as the example from repo but AllowUDPConnections set to false
from network.
Thanks to point that out. It shouldn't be public in first place. Will change that later on.
Regarding your issue, dont use that event... It wont fire, since it will never be called (No UDP possible) and it shouldnt be visible in first place :)
Sorry for the inconvenience
from network.
no problem client send / receive packet now
from network.
Related Issues (20)
- Crashing if variables on connection event.
- Static strings cause crashes
- WritePacketThreadException with Unity build on android HOT 9
- Problem when sending a packet from server to client HOT 5
- Can this library send and receive structs ? HOT 2
- Calling ServerConnectionContainer.Stop or ServerConnectionContainer.StopTcpListener() Throws an Exception HOT 1
- Cannot communicate withe IPv4 address HOT 4
- Using Network with mono HOT 4
- A Task was cancelled HOT 7
- license usage within closed source commercial game HOT 1
- not sure what i'm missing when using the registerstaticpacket handler HOT 1
- Connection closes with the reason "AssemblyDoesNotExist" after sending custom packets
- AssemblyDoesNotExist when sending strings HOT 2
- Unnecessary dependency Microsoft.CSharp HOT 1
- System.IO.EndOfStreamException: 'Unable to read beyond the end of the stream.' HOT 1
- Classes in packets get instantiated as the parent variable Type rather than the Type they were initially when being sent
- Connection closed event not raised when connection times out
- Packet handler in Client is not called after reconnecting
- possible infinite loop problem at runtime HOT 1
- Structs are unsupported
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from network.