I made an online game that uses the UDP protocol to communicate between the clients and a server. However, since UDP is connection-less, I can't detect if a client closed the game or an error occurred in the network. Therefore, I need to make UDP a connection-oriented protocol, or at least detect network errors. How could I accomplish that? How is TCP connection oriented?
Making UDP a connection-oriented protocol?
947 views Asked by None At
2
There are 2 answers
1
Phil Taprogge
On
As you say, UDP has no concept of connections. So the only way to achieve what you want is to implement the required logic yourself on top of UDP.
You could, for example, have your clients 'check in' with the server regularly with a UDP packet containing a unique ID. If the server does not receive this from a client for some time, it would consider that client dead.
Related Questions in C#
- How to call a C language function from x86 assembly code?
- What does: "char *argv[]" mean?
- User input sanitization program, which takes a specific amount of arguments and passes the execution to a bash script
- How to crop a BMP image in half using C
- How can I get the difference in minutes between two dates and hours?
- Why will this code compile although it defines two variables with the same name?
- Compiling eBPF program in Docker fails due to missing '__u64' type
- Why can't I use the file pointer after the first read attempt fails?
- #include Header files in C with definition too
- OpenCV2 on CLion
- What is causing the store latency in this program?
- How to refer to the filepath of test data in test sourcecode?
- 9 Digit Addresses in Hexadecimal System in MacOS
- My server TCP doesn't receive messages from the client in C
- Printing the characters obtained from the array s using printf?
Related Questions in NETWORK-PROGRAMMING
- "(Reason: CORS header ‘Access-Control-Allow-Origin’ missing)" while trying to access Actix webserver from Wix site
- My server TCP doesn't receive messages from the client in C
- I am currently trying to implement a rudimentary firewall from a video I watched but the nimda worm detection is not working and i do not know why?
- Is there a way to trigger a network buffer flush in Python?
- Redirect outbound traffic to a different port
- Post request response time spikes
- How to connect docker container to vpn site to site
- EADDRNOTAVAIL Node JS
- How to handle Okhttp3 POST Failing after changing location? Roaming issue?
- Why my message doesn't write into the socket when I try to read the response after sending it?
- Networkx Multiple Circular Layouts Combined Together
- trivial socket program failing at accept() with errno 22
- getaddrinfo() returning unexpected results
- JmDNS create() function not working on my device
- What C code will determine the network adapter being used by an open socket?
Related Questions in UDP
- Discussion on using golang to implement UDP client timeout retransmission
- What is the correct way to setup and use the Ethernet library in Arduino in order to send and receive UDP broadcast messages between LAN devices?
- Multicast packets not received on windows
- Microcontroller hangs with LWIP UDP
- UDP socket client not able to receive data
- "Parameter is not valid" exception when using Image.FromStream() - UDP Video live stream
- k3s change requested UDP port assignment
- Why does the python client socket receiving a reply but still throw the exception in some threadings?
- Gnuradio "double free or corruption (!prev)" error
- Why we need wraparound in UPD checksum algorithm?
- Simple Java UDP server/client-program works on local machine but not over either LAN (different machines) or internet
- Docker bridge does not transmit from tcpreplay IPv6/UDP/GTP traffic
- trying to send TCP packet and recieve it back and count time in client+server app
- recvmsg returns EAGAIN after select reports file descriptor is ready
- Receiving UDP broadcast on Android
Related Questions in CONNECTION
- MongoDb not connecting C#
- Frontend fetching data from unexpected localhost address despite proxy configuration
- recognize_google fails with WinError 10060
- April fools - PsExec (PsTools)
- Unable to resolve service name to its IP inside kubernetes cluster
- Is there a way to create connection pooling in codeigniter 3 using custom mysqli driver?
- Error in releasing pool connection in node project
- Is there a way in Laravel to use multiple connections simultaneously in a combined manner?
- Not able to inject RedisCache/SyncCache/StatefulRedisConnection beans in micronaut 4.2.1 version
- How to send a big array to a client faster
- Connection Type not visible in Airflow connections
- Cannot connect to an Oracle XE database from C#
- SSMS Update Causes Connection Failure and Exception Error
- Mutual connections in Strapi
- Microsoft SQL Server Express Java Connection
Related Questions in RUDP
- How to create a simple Server Client Application Using RUDP in Java?
- Checksum checking in UDP using UDP socket
- RUDP Packets are not read from inputstream
- TCP, UDP, SCTP, RUDP or RAW?
- RUDP implementation other than bell labs implementation?
- Reliable UDP Protocol Implementation in Java - Why does this happen?
- Is there Reliable UDP implementation for C++ with python asyncio bindings?
- websockets protocols?
- Broadcasting in RUDP, UDT, LWIP, DCCP
- TCP vs Reliable UDP
- Error Occurs with QUIC_TLS_CERTIFICATE_UNKNOWN When Attempting WebTransport Connection
- Is there a way to callback a function without creating a new goroutine?
- how to use maidsafe-rudp as part of my project?
- change FTP server's transport protocol (pyftpdlib)
- Making UDP a connection-oriented protocol?
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Firstly, I understand that you need UDP because of efficiency - but maybe you could try to give TCP a try?
Otherwise I would just do as @Phil Taprogge mentioned. Send a specific UDP package that gets identified by the server every n seconds. If the server does not recieve it for 3*n seconds it is very likely that the client has disconnected.