WICG / direct-sockets

Direct Sockets API for the web platform
Other
355 stars 14 forks source link

UDP Direct Sockets are not getting connected to "TCPServerSocket" #72

Closed freakysiddhesh closed 1 month ago

freakysiddhesh commented 1 month ago

Hey Folks,

I am trying to establish a communication between a Client who is creating a UDP Direct Socket and a server who is using TCPServerSocket API, but the connection is not at all getting establish, it is getting stuck somewhere in the handshake process.

Also online there is no working code example present currently.

If anyone has any working code example please share or let me know what all things to care for

reillyeon commented 1 month ago

You can't use UDP to connect to a TCP server. If you are building two applications using this API to establish a TCP connection, use a TCPSocket in the client and TCPServerSocket in the server.

This file provides a demo of creating a TCP server and this file provides a demo of creating a TCP client.

freakysiddhesh commented 1 month ago

Hello @reillyeon ,

Thanks for update, but my question is then for what UDP Sockets used or connect to then, or they can not be used currently, if you have any working example that uses "UDP Direct Sockets" do help me and share the code of working example with me.

I am kind of new in this area but I am trying to make a Isolated Web Apps and want to use UDP there.

Thanks, Siddhesh Dalvi

reillyeon commented 1 month ago

If you are new to networking, I recommend finding general tutorials online. They might not help you learn how to use the Direct Sockets API specifically (since it is so new) but will help you learn the basics which you can apply to this API later.

freakysiddhesh commented 1 month ago

Yeah I have kind of gone through them for normal sockets, can you help me find any working example FOR UDP DIRECT SOCKETS?