As it is seen that the Spymemcache client use TCP connection to connect with Memcached server as default. I want to use UDP instead of TCP. I think Facebook use UDP to get() requests from Memcached.
Any one know how to use UDP with SpyMemcache ?
Related
I have an IOT device which is sending data continuously to a configured server using TCP protocol.
Can i receive the data using HTTP protocol and any java http services application like spring-boot application?
Device details : https://teltonika.lt/product/fmb920/
As the device was returning the data in TCP protocol so I could not get any solution to get data in http protocol.
I achieved that by establishing the TCP connection using sockets.
I have 2 components, A and B, on different LANs with a Linux server between which acts as gateway for both LANs.
A sends TCP traffic to B using a gateway deployed on the public Internet. Therefore, no SYN is sent from A to B via the Linux server. However, C sends TCP traffic back to A using a local TCP connection (the gateway is not involved). By sniffing the traffic, I can see that C is not establishing a regular TCP connection (SYN) but starts by sending (SYN+ACK).
I'm using iptables on the Linux server to redirect locally the TCP traffic sent by C to A. Traffic is redirected to local port 9000.
However, I would also like to intercept this traffic, therefore I've built a simple Netty proxy which listens on port 9000. For some reason, Netty doesn't receive or ignore this traffic.
I wonder if Netty is able to manage the case of a SYN-ACK without SYN.
Any idea?
The question is whether the TCP protcool implementation stack in the kernel will manage it.
Netty won't even see it, whether managed by TCP/IP or not.
Netty isn't an implementation of TCP/IP. It is an API layered over the Java API, which is layered over the BSD Sockets API, and none of those is an implementation of TCP/IP either. It can't see any further into the network than calling listen() and accept() in this case.
I made a UDP server and now I want the server to be TCP, I don't like losing packets.
Will it be hard to reverse it to TCP or just a few things?
What things should I change to make it TCP?
Can I still use all my packet classes?
I know I have to change the DatagramSocket but don't know to what.
You should read about TCP sockets in Java, as Parker suggested.
If you want advanced functionalities for your server, such as session management, you can use a socket framework like Apache MINA or Netty.
I am learning about UDP client server where the communication is one way from Server to Client. Server will send UDP packets to Client.
I want to to make it dual communication where Server and Client can send UDP packets to each other.
Do I need to make another Datagram socket for Client Server to make it dual communication or can I use my existing Datagram socket to do the job. If I dont need another Datagram Socket , I would appreciate if you can show me how it is done
I would appreciate if you can point me to relevant resources on dual commuication for Client Server
Yes, you can use the existing DatagramSocket.
Take a look at example in this link:
http://phoenix.goucher.edu/~kelliher/s2011/cs325/feb25.html
Its upon you how to use the send and receive methods of a socket depending on your needs.
How can I make a server connect to another server in java
My program is replicated file system. So , I need the client to connect to the server in order to read or write in the text file. which is easy to implement throw TCP connection . but the problem is how can i make the server connect other servers to avoid conflicting in the text file.
I have read about multicast throw UDP connection. can I make the server have to kind of connection one using TCP with client and another connection using TCP to multicast request to other servers in the group ?
Or if there are anther way to implement that?
Thank you
I would suggest you to look at group communication frameworks, such as jgroups.
Look here for explanation on TCP transport.