spot7.org logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
  Home » SOCKETS » Page 1
Can't get TClientSocket to receive buffer values
Your code has no structured protocol to it. TCP is a stream of raw bytes, and you are sending everything as strings (and not doing a very good job of it - no error handling, no partial send/receive handling, etc). You need to delimit your fields/messages from one another. Then the receiver can look for those delimiters. You would have to read everything from the socket into an intermediate buffer,

Categories : Sockets

UDP socket using select() stops receiving after first iteration and data inequality
You aren't testing for errors in select() correctly. You can get an error in one of them. The test should be recieve == -1 || sent == -1, but I cannot imagine why you are calling select() twice at all, or even why you're using two sockets. You only need one select. Try it that way, you'll probably drive out some other bugs. NB You can't rely on the second socket descriptor being greater than the

Categories : Sockets

In C, how to malloc and free a SOCKET (already a pointer)
If you look at winsock.h more closely, you will see that SOCKET is not a pointer, it is an integer: typedef UINT_PTR SOCKET; UINT_PTR is not a pointer to a UINT (PUINT and LPUINT are). It is a UINT that is the same size as a pointer. So UINT_PTR is 4 bytes in a 32bit process and is 8 bytes in a 64bit process. See MSDN's documentation for more details on that: Windows Data Types UINT_PTR

Categories : Sockets

Need more insights in listen system call linux
A host can receive packets from anywhere at any time. With TCP, before you call listen the operating system responds to any arriving packet with an RST packet. After listen it will reply to SYN packets with a SYN-ACK packet, and adds information about the remote side to the list of pending "connections", and the connection is now established. With UDP there are no connections. If an application i

Categories : Sockets

Multiple service connections vs internal routing in MMO
This seems to be multiple questions in one package. I will try to answer the ones I can identify as separate... UDP vs TCP: You're saying "real-time", this usually means UDP is the right choice. However, that means having to deal with lost packets and possible re-ordering of packets. But, using UDP leaves a couple of possible delay-decreasing tricks open. Multiple connections from a single clien

Categories : Sockets

What are the different between VMCI socket, Berkeley Socket and winsock?
Berkeley Sockets is the original TCP/IP API and is found in Unix-based operating systems. Winsock is a source and binary API/ABI which was created to bring order out of the confusion of multi-vendor TCP/IP on Windows in the 1990s before Microsoft clued up. It is found on Windows. VCMI is for communicating between VMWare hosts and guests, or between guests.

Categories : Sockets

"Real time" app or near to it
Cache frequently sent data so that database calls and other processing can be avoided. Use equipment suitable for high volume network traffic and servers that can handle high load Drop traffic when your server is absolutely too busy to handle it If possible, program clients so that they will connect at various intervals - not all at once. Maintain multiple servers and use a load balancer to distr

Categories : Sockets

Forward Bluetooth socket to serial port
Figures that I'd get it right after posting. To anyone else looking to do something similar: Pair with bluez-simple-agent Create your serial port channel with sdptool add --channel=x sp Listen for a connection on that channel with sudo rfcomm listen /dev/rfcomm0 x Cross the streams with socat /dev/rfcomm0 /dev/usb/lp0 Beautiful. It's all so simple now.

Categories : Sockets

How to build forged ICMP "Destination Unreachable" Type 3 Code 4 packet
There are a few pointers I outlined in this answer and in its comments: The specification requires that the original IP header that is encapsulated in the ICMP error message (i.e. ip_orig) is exactly identical to the one received. Therefore, setting just its source IP address and destination IP addresses (i.e. ip_orig.src and ip_orig.dst, respectively) is probably not enough. The sequence number

Categories : Sockets

SOCKET variable remains undeclared after being declared in another function
The class member m_ipsocket is visible to class functions like GazeTracking::InitializeConnection. The functionstartreceiving` isn't a class member. Therfore it can't access the member of the class without specifing how you access it. When m_ipsocket is an ordinary member. You need an instance of the class. gazeTrack.m_ipsocket This requires that you have an object gazeTrack. Each instance of

Categories : Sockets

Using Socket.io to emit and receive messages on the client
The code below: socket.on('news', function(data) { console.log(data); }); runs in your server application so you should see them in your cmd (windows) instead of the browser. Just to be safe hard code the socket.emit('news', {my: 'data'}); in your client application/script if you can't still see the log in your terminal. Socket.io might not be available in the window if you do it that way. I

Categories : Sockets

What does "An out-of-band data transmission mechanism may be supported" mean, in socket man page
Out-of-band (OOB) means "communication that you do that is not the actual data that you are communicating". For example, if you are in a "conversation" with an end point - it is sending you requests and you are sending it data - and it wants to tell you to slow down midway through a bunch of data, it would need an "out of band" transmission mechanism to say "whoa, stop for a moment". http://en.w

Categories : Sockets


Recently Add
How to format the HTTP response
Can't get TClientSocket to receive buffer values
UDP socket using select() stops receiving after first iteration and data inequality
In C, how to malloc and free a SOCKET (already a pointer)
Need more insights in listen system call linux
Multiple service connections vs internal routing in MMO
What are the different between VMCI socket, Berkeley Socket and winsock?
"Real time" app or near to it
Forward Bluetooth socket to serial port
How to build forged ICMP "Destination Unreachable" Type 3 Code 4 packet
SOCKET variable remains undeclared after being declared in another function
Using Socket.io to emit and receive messages on the client
What does "An out-of-band data transmission mechanism may be supported" mean, in socket man page
© Copyright 2017 spot7.org Publishing Limited. All rights reserved.