¡@

Home 

c++ Programming Glossary: socket

Why should exceptions be used conservatively?

http://stackoverflow.com/questions/1744070/why-should-exceptions-be-used-conservatively

that in mind. Think memory leaks file descriptor leaks socket leaks who knows Maintenance complications It's harder to maintain..

C++ Winsock P2P

http://stackoverflow.com/questions/2843277/c-winsock-p2p

my knoweldge. c winsock p2p distributed computing winsockets share improve this question Since I don't know what information.. you are looking for I'll try to describe how to set up a socket program and what pitfalls I've run into. To start with read.. message and disconnect. It's great for getting a feel for socket programming. With that lets start Considerations blocking or..

How do you serialize an object in C++?

http://stackoverflow.com/questions/523872/how-do-you-serialize-an-object-in-c

of objects that I need to serialize and transmit via a socket connection. I need to both serialize the object then deserialize.. array of bytes then back into an object. I can handle the socket transmission. c serialization marshalling c faq share improve.. the serialized data over the net I'd either use Berkeley sockets or the asio library . Edit If you want to serialize your objects..

C++ SMTP Example

http://stackoverflow.com/questions/58210/c-smtp-example

#include iostream #include sys types.h #include sys socket.h #include netinet in.h #include netdb.h #include stdio.h using.. r n char wkstr 100 hello how r u r n Send a string to the socket void send_socket char s write sock s strlen s write 1 s strlen.. hello how r u r n Send a string to the socket void send_socket char s write sock s strlen s write 1 s strlen s printf Client..

Object destruction in C++

http://stackoverflow.com/questions/6403055/object-destruction-in-c

be released when the object is destructed such as a file a socket a database connection a mutex or heap memory . array elements..

Sleep less than one millisecond

http://stackoverflow.com/questions/85122/sleep-less-than-one-millisecond

then the select won't allow you to be called without any socket so you have to do a little more to create a microsleep method.. usleep long usec struct timeval tv fd_set dummy SOCKET s socket PF_INET SOCK_STREAM IPPROTO_TCP FD_ZERO dummy FD_SET s dummy..

C++ Socket Server - Unable to saturate CPU

http://stackoverflow.com/questions/1234750/c-socket-server-unable-to-saturate-cpu

Socket Server Unable to saturate CPU I've developed a mini HTTP server..

Java Runtime Performance Vs Native C / C++ Code?

http://stackoverflow.com/questions/1984856/java-runtime-performance-vs-native-c-c-code

of making system calls from Java For example creating a Socket object as opposed to the C socket API. Finally I recall reading.. of making system calls from Java For example creating a Socket object as opposed to the C socket API. Roughly the same. Why..

How to write a GUI for a large cross-platform C++ project?

http://stackoverflow.com/questions/2191684/how-to-write-a-gui-for-a-large-cross-platform-c-project

with the logic on the relevant Win Linux machine through Socket or similar method. Is it a good idea to do so c gui cross platform.. option What are other possibilities ...but not that much. Sockets would be overkill exception see question 5 . Usually you split.. with the logic on the relevant Win Linux machine through Socket or similar method. Is it a good idea to do so I think this makes..

Socket Exception: “There are no more endpoints available from the endpoint mapper”

http://stackoverflow.com/questions/272523/socket-exception-there-are-no-more-endpoints-available-from-the-endpoint-mappe

Exception &ldquo There are no more endpoints available from.. question On a very busy server you may be running out of Sockets. You may have to adjust some TCPIP parameters. Adjust these..

Performance of C++ vs Virtual Machine languages in high frequency finance

http://stackoverflow.com/questions/3175072/performance-of-c-vs-virtual-machine-languages-in-high-frequency-finance

side. Now admittedly that is a simple benchmark with no Socket IO and socket IO can be ugly as would be at the end points of..

Getting started with client-server networking

http://stackoverflow.com/questions/4046404/getting-started-with-client-server-networking

However creating a Server in Java is done this way ServerSocket server new ServerSocket 8888 8888 is the port the server will.. in Java is done this way ServerSocket server new ServerSocket 8888 8888 is the port the server will listen on. Socket is the.. 8888 8888 is the port the server will listen on. Socket is the word you are probably looking for if you want to do research...

Socket API or library for C++?

http://stackoverflow.com/questions/4199185/socket-api-or-library-for-c

API or library for C I recently have been getting more into.. question I am actually looking to find out what the Socket API's libraries are for C . I am fairly new at socket programming.. socket or C socket . Here is what I've found for C socket Socket . ENUt . LibSylph . CPPSocket might also work for you although..

substitute for fork()ing? in windows

http://stackoverflow.com/questions/4243880/substitute-for-forking-in-windows

1 cout Could not create socket. endl continue else cout Socket Created. endl clearing in use ports. if setsockopt sockfd SOL_SOCKET..

Using SSL sockets and non-SSL sockets simultaneously in Boost.Asio?

http://stackoverflow.com/questions/4720120/using-ssl-sockets-and-non-ssl-sockets-simultaneously-in-boost-asio

boost asio ssl context context socket_ io_service secureSocket_ io_service context private boost asio ip tcp socket socket_.. boost asio ssl stream boost asio ip tcp socket secureSocket_ And within there are a bunch of handlers that reference socket_.. in several places which would need to become secureSocket_.lowest_layer .is_open for the other socket. Can anyone suggest..

C++ SMTP Example

http://stackoverflow.com/questions/58210/c-smtp-example

Server s n buf MAIN int main int argc char argv Create Socket sock socket AF_INET SOCK_STREAM 0 if sock 1 perror opening stream..

Subclass/inherit standard containers?

http://stackoverflow.com/questions/6806173/subclass-inherit-standard-containers

future changes. For instance say you have a class of type Socket that communicates using the TCP protocol and you extend it's.. and you extend it's behavior by deriving a class SSLSocket from Socket and implementing the behavior of the higher SSL.. extend it's behavior by deriving a class SSLSocket from Socket and implementing the behavior of the higher SSL stack protocol..

Pimpl idiom vs Pure virtual class interface

http://stackoverflow.com/questions/825018/pimpl-idiom-vs-pure-virtual-class-interface

Clone method is usually more appropriate. Examples A Socket class a Database class a policy class anything that would be..

Socket Timeout in C++ Linux

http://stackoverflow.com/questions/933122/socket-timeout-in-c-linux

Timeout in C Linux Ok first of all I like to mention what im..

Can't we use threads inside the member function of class?

http://stackoverflow.com/questions/12840881/cant-we-use-threads-inside-the-member-function-of-class

succeeds for ptr result ptr NULL ptr ptr ai_next Create a SOCKET for connecting to server sock_ socket ptr ai_family ptr ai_socktype.. ai_family ptr ai_socktype ptr ai_protocol if sock_ INVALID_SOCKET printf socket failed with error ld n WSAGetLastError WSACleanup.. with error ld n conResult conResult setsockopt sock_ SOL_SOCKET SO_RCVTIMEO const char nTimeout sizeof DWORD if conResult NO_ERROR..

Example code of libssh2 being used for port forwarding

http://stackoverflow.com/questions/1580750/example-code-of-libssh2-being-used-for-port-forwarding

0 int other_port 0 fd_set read_set write_set SOCKET sshsock socket AF_INET SOCK_STREAM 0 iretval connect sshsock.. inet_addr 127.0.0.1 localhost.sin_port htons 5900 SOCKET local_sock socket AF_INET SOCK_STREAM IPPROTO_TCP ioctlsocket.. local_sock sockaddr localhost sizeof localhost if iretval SOCKET_ERROR iretval WSAGetLastError while 1 bytes_read libssh2_channel_read..

Detaching a native socket from Boost.ASIO's socket class

http://stackoverflow.com/questions/2043837/detaching-a-native-socket-from-boost-asios-socket-class

using Boost.ASIO then passes back a native Windows SOCKET on success or 0 on failure. Unless I'm mistaken the native socket..

C++ Winsock P2P

http://stackoverflow.com/questions/2843277/c-winsock-p2p

tend to return alot of information. Everytime you get a SOCKET_ERROR or INVALID_SOCKET check the Winsock Error Messages to.. information. Everytime you get a SOCKET_ERROR or INVALID_SOCKET check the Winsock Error Messages to look it up Setting up the.. listening socket to accept new connections. The easiest is SOCKET s socket AF_INET SOCK_STREAM IPPROTO_TCP sockaddr_in localAddress..

C++ Boost.ASIO: passing accepted TCP connection from one opened socket to another using Windows APIs ( while works with Linux APIs)?

http://stackoverflow.com/questions/5326564/c-boost-asio-passing-accepted-tcp-connection-from-one-opened-socket-to-anothe

pi WSADuplicateSocket socket.native GetCurrentProcessId pi SOCKET socketDup WSASocket pi.iAddressFamily AF_INET pi.iSocketType..

What is the overhead cost of an empty vector?

http://stackoverflow.com/questions/557997/what-is-the-overhead-cost-of-an-empty-vector

How to set up a Winsock UDP socket?

http://stackoverflow.com/questions/679145/how-to-set-up-a-winsock-udp-socket

htons destination port number create the socket SOCKET s socket AF_INET SOCK_DGRAM IPPROTO_UDP bind to the local address..

Blocking socket returns EAGAIN

http://stackoverflow.com/questions/735249/blocking-socket-returns-eagain

like this int error 0 fd_set rset fd_set wset int n const SOCKET sock m_Socket set the socket as nonblocking IO const int flags.. sock wset socklen_t len sizeof error if getsockopt SOL_SOCKET SO_ERROR error len 0 return 1 else return 1 done We change the.. receive timeout set on the socket via setsockopt sock SOL_SOCKET SO_RCVTIMEO ... as that would also cause recv to return EAGAIN..

Sleep less than one millisecond

http://stackoverflow.com/questions/85122/sleep-less-than-one-millisecond

method int usleep long usec struct timeval tv fd_set dummy SOCKET s socket PF_INET SOCK_STREAM IPPROTO_TCP FD_ZERO dummy FD_SET..

How can I hook Windows functions in C/C++?

http://stackoverflow.com/questions/873658/how-can-i-hook-windows-functions-in-c-c

#pragma comment lib detoured.lib int WINAPI Real_Send SOCKET s const char buf int len int flags send int WINAPI Real_Recv.. const char buf int len int flags send int WINAPI Real_Recv SOCKET s char buf int len int flags recv int WINAPI Mine_Send SOCKET.. s char buf int len int flags recv int WINAPI Mine_Send SOCKET s const char buf int len int flags int WINAPI Mine_Recv SOCKET..