How to create TCP proxy for SSL stream - c#

There's a transparent BLE to IP communication established between mobile (Xamarin) and BLE device.
The high-level diagram is the following:
Mobile TCP/IP socket <---> BLE Central <---> BLE Peripheral <---> SSL server on device
I want to establish TLS session over BLE, for this purpose the client connects to Mobile TCP/IP server socket over SSLStream, but on a method AuthenticateAsClient it hangs and mobile TCP/IP socket doesn't receive any data.
Taking in account that SSL is located above TCP I was expecting that TCP socket will receive all data related to SSL handshake process..
Please advise any ideas how to solve this.

Related

Is it possible to read Devices from client system while using TCP Connection

I have established connection with client system through socket in c# webapplication, in my connected client system i have connected PTZ ip camera thorough USB 3.0 cable. Is it possible to read camera informations from server system using TCP connection.

How can I establish a UDP connection from AWS game server to Smartphone Unity Game

How does one connect to a client from a remote server using UDP if all we can get is the global IP (the router's IP)?
I am getting the global IP of the client using the code:
string externalIp = new WebClient().DownloadString("http://icanhazip.com");
Is there a way to get a client's local IP? Also to which IP address should my server connect when using UDP?
What I ended up doing is to use a game service like GameSparks to send TCP and UDP port information from my server to each game client. The game client would then connect to the TCP and UDP port which would give the server knowledge of the client's endpoint. This way a two way communication can be established with both TCP and UDP.

Getting UdpClient from a connected TcpClient?

I'm trying to setup a Udp connection after a Tcp connection has been made. All of the connection states and control goes through Tcp, but I want the client and server to be able to talk through Udp as well. This is my problem.
The server will have many clients connected to it on separate threads. I have it %100 working fine with just Tcp binded, but I want to use Udp. Because of Udp Hole Punching I'm having a hard time listening for a specific endpoint on Udp because the endpoint can change when communicating with a NAT device.
So, to put the question simply: How do I easily get a "UdpClient" connection going from a TcpClient connection to reference?
Thank you in advance!
There will be no tunnel for UDP, just because you have a successful TCP connection.
You have to establish the UDP connection the same way you got the TCP connection. E.g. if the TCP connection was established from intern to outside you have to do the same with UDP, otherwise the NAT device will not establish a connection for the UDP connection and thus packets from the peer will not be sent to you.

NP304 3onedata C# socket send directly from server to device.

How can I send data from my C# socket program to my clients?
Currently I have two programs, server and client.
I start my server, then my clients connect to server, in this way they are connected together, but now I want to send directly from server to client?
As my client cannot start its own connection, of course I have IP and port of my client, how can I send data from my server to a client with known IP and port?
Thanks.
Since your clients are not computer programs you can control, you really have no chance but to contact them from the server. If your clients can handle TCP communications, you need to treat them as servers, and Connect from the server to each client (open the socket on the server side, and Connect to each client IP and port).
It's possible that your clients understand UDP and not TCP. That is actually going to be easier for you, as you only need to create one UDP socket, and use SendTo to send a data to each client (one SendTo call per client).
Let's just hope your clients aren't stuck on the Ethernet level...
I would say that COM-ports are slightly easy to communicate than implementing TCP/IP protocol on your device. Could your device read/write its COM-port?

Forward data from ip socket to bluetooth socket. c#

I want to listen to incoming ip sockets on a specific port and forward them using bluetooth sockets.
Is this possible?
I'm using c# but I can use java if it's easier to code.
In fact, the object was using SMB protocol over Bluetooth connexion. I found a Bluetooth profile that is similar to SMB protocol and that enables me to explore the sdcard from my PC. the profile is OBEX FTP (File Transfert Profile) and i found java APIs.
Thank you for your answers.
The Bluetooth equivalent of TCP sockets are called RFCOMM sockets. You can write an app to open a TCP socket, read the data, and write it out to an RFCOMM socket.

Categories