Search Results

Search found 328 results on 14 pages for 'recv'.

Page 1/14 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How large should my recv buffer be when calling recv in the socket library

    - by Silmaril89
    Hi, I have a few questions about the socket library in C. Here is a snippet of code I'll refer to in my questions. char recv_buffer[3000]; recv(socket, recv_buffer, 3000, 0); First, How do I decide how big to make recv_buffer? I'm using 3000, but it's arbitrary. Second, what happens if recv() receives a packet bigger than my recv_buffer? Third, how can I know if I have received the entire message without calling recv again and have it wait forever when there is nothing to be received? And finally, is there a way I can make a buffer not have a fixed amount of space, so that I can keep adding to it without fear of running out of space? maybe using strcat to concatenate the latest recv() response to the buffer? I know it's a lot of questions in one, but I would greatly appreciate any responses.

    Read the article

  • while(1) block my recv thread

    - by zp26
    Hello. I have a problem with this code. As you can see a launch with an internal thread recv so that the program is blocked pending a given but will continue its execution, leaving the task to lock the thread. My program would continue to receive the recv data socket new_sd and so I entered an infinite loop (the commented code). The problem is that by entering the while (1) my program block before recv, but not inserting it correctly receives a string, but after that stop. Someone could help me make my recv always waiting for information? Thanks in advance for your help. -(IBAction)Chat{ [NSThread detachNewThreadSelector:@selector(riceviDatiServer) toTarget:self withObject:nil]; } -(void)riceviDatiServer{ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc]init]; labelRicevuti.text = [[NSString alloc] initWithFormat:@"In attesa di ricevere i dati"]; char datiRicevuti[500]; int ricevuti; //while(1){ ricevuti = recv(new_sd, &datiRicevuti, 500, 0); labelRicevuti.text = [[NSString alloc] initWithFormat:@"%s", datiRicevuti]; //} [pool release]; }

    Read the article

  • recv returns old data

    - by anon
    This loop is supposed to take data from a socket line by line and put it in a buffer. For some reason, when there is no new data to return, recv returns the last couple lines it got. I was able to stop the bug by commenting out the first recv, but then I cant tell how long the next line will be. I know it's not a while(this->connected){ memset(buf, '\0', sizeof(buf)); recv(this->sock, buf, sizeof(buf), MSG_PEEK); //get length of next message ptr = strstr(buf, "\r\n"); if (ptr == NULL) continue; err = recv(this->sock, buf, (ptr-buf), NULL); //get next message printf("--%db\n%s\n", err, buf); tok[0] = strtok(buf, " "); for(i=1;tok[i-1]!=NULL;i++) tok[i] = strtok(NULL, " "); //do more stuff }

    Read the article

  • If a nonblocking recv with MSG_PEEK succeeds, will a subsequent recv without MSG_PEEK also succeed?

    - by Michael Wolf
    Here's a simplified version of some code I'm working on: void stuff(int fd) { int ret1, ret2; char buffer[32]; ret1 = recv(fd, buffer, 32, MSG_PEEK | MSG_DONTWAIT); /* Error handling -- and EAGAIN handling -- would go here. Bail if necessary. Otherwise, keep going. */ /* Can this call to recv fail, setting errno to EAGAIN? */ ret2 = recv(fd, buffer, ret1, 0); } If we assume that the first call to recv succeeds, returning a value between 1 and 32, is it safe to assume that the second call will also succeed? Can ret2 ever be less than ret1? In which cases? (For clarity's sake, assume that there are no other error conditions during the second call to recv: that no signal is delivered, that it won't set ENOMEM, etc. Also assume that no other threads will look at fd. I'm on Linux, but MSG_DONTWAIT is, I believe, the only Linux-specific thing here. Assume that the right fnctl was set previously on other platforms.)

    Read the article

  • probelm with recv() on a tcp connection

    - by michael
    Hi, I am simulating TCP communication on windows in C I have sender and a receiver communicating. sender sends packets of specific size to receiver. receiver gets them and send an ACK for each packet it received back to the sender. If the sender didn't get a specific packet (they are numbered in a header inside the packet) it sends the packet again to the receiver. Here is the getPacket function on the receiver side: //get the next packet from the socket. set the packetSize to -1 //if it's the first packet. //return: total bytes read // return: 0 if socket has shutdown on sender side, -1 error, else number of bytes received int getPakcet(char *chunkBuff,int packetSize,SOCKET AcceptSocket){ int totalChunkLen = 0; int bytesRecv=-1; bool firstTime=false; if (packetSize==-1) { packetSize=MAX_PACKET_LENGTH; firstTime=true; } int needToGet=packetSize; do { char* recvBuff; recvBuff = (char*)calloc(needToGet,sizeof(char)); if(recvBuff == NULL){ fprintf(stderr,"Memory allocation problem\n"); return -1; } bytesRecv = recv(AcceptSocket, recvBuff, needToGet, 0); if (bytesRecv == SOCKET_ERROR){ fprintf(stderr,"recv() error %ld.\n", WSAGetLastError()); totalChunkLen=-1; return -1; } if (bytesRecv == 0){ fprintf(stderr,"recv(): socket has shutdown on sender side"); return 0; } else if(bytesRecv > 0) { memcpy(chunkBuff + totalChunkLen,recvBuff,bytesRecv); totalChunkLen+=bytesRecv; } needToGet-=bytesRecv; } while ((totalChunkLen < packetSize) && (!firstTime)); return totalChunkLen; } i use firstTime because for the first time the receiver doesn't know the normal package size that the sender is going to send to it, so i use a MAX_PACKET_LENGTH to get a package and then set the normal package size to the num of bytes i have received my problem is the last package. it's size is less than the package size so lets say last package size is 2 and the normal package size is 4. so recv() gets two bytes, continues to the while condition, then totalChunkLen < packetSize because 2<4 so it iterates the loop again and the gets stuck in recv() because it's blocking because the sender has nothing to send. on the sender side i can't close the connection because i didn't ACK back, so it's kind of a deadlock. receiver is stuck because it's waiting for more packages but sender has nothing to send. i don't want to use a timeout for recv() or to insert a special character to the package header to mark that it is the last one what can i do ? thanks

    Read the article

  • python socket.recv/sendall call blocking

    - by fsm
    Hi everyone. This post is incorrectly tagged 'send' since I cannot create new tags. I have a very basic question about this simple echo server. Here are some code snippets. client while True: data = raw_input("Enter data: ") mySock.sendall(data) echoedData = mySock.recv(1024) if not echoedData: break print echoedData server while True: print "Waiting for connection" (clientSock, address) = serverSock.accept() print "Entering read loop" while True: print "Waiting for data" data = clientSock.recv(1024) if not data: break clientSock.send(data) clientSock.close() Now this works alright, except when the client sends an empty string (by hitting the return key in response to "enter data: "), in which case I see some deadlock-ish behavior. Now, what exactly happens when the user presses return on the client side? I can only imagine that the sendall call blocks waiting for some data to be added to the send buffer, causing the recv call to block in turn. What's going on here? Thanks for reading!

    Read the article

  • The behavior of send() and recv() in socket communication

    - by gc
    The following is the setup: Server Client | | accept connect | | v | send msg1- | | | v v recv <- send | | v v send msg2- recv | | v v close Here is my question: 1. Client actually receives msg1 before it closes, why is it like this? 2. send msg2 returns normally. Since client closes after receiving msg1, why is send msg2 successful?

    Read the article

  • realloc()ing memory for a buffer used in recv()

    - by Hristo
    I need to recv() data from a socket and store it into a buffer, but I need to make sure get all of the data so I have things in a loop. So to makes sure I don't run out of room in my buffer, I'm trying to use realloc to resize the memory allocated to the buffer. So far I have: // receive response int i = 0; int amntRecvd = 0; char *pageContentBuffer = (char*) malloc(4096 * sizeof(char)); while ((amntRecvd = recv(proxySocketFD, pageContentBuffer + i, 4096, 0)) > 0) { i += amntRecvd; realloc(pageContentBuffer, 4096 + sizeof(pageContentBuffer)); } However, this doesn't seem to be working properly since Valgrind is complaining "valgrind: the 'impossible' happened:". Any advice as to how this should be done properly? Thanks, Hristo

    Read the article

  • recv receiving not whole data sometime

    - by milo
    hi all, i have following issue: here is the chunk of code: void get_all_buf(int sock, std::string & inStr) { int n = 1; char c; char temp[1024*1024]; bzero(temp, sizeof(temp)); n = recv(sock, temp, sizeof(temp), 0); inStr = temp; }; but sometimes recv returning not whole data (data length always less then sizeof(temp)), only it's part. write side always sends me whole data (i got it with sniffer). what matter? thx. P.S. i know, good manner suggests me to check n (if (n < 0) perror ("error while receiving data), but it doesn't matter now - it's not reason of my problem. P.S.2 i've forgot - it's blocking socket.

    Read the article

  • Windows recv method usage

    - by vandamon taigi
    I'm making a multiplayer game and I have an issue with the recv function ( or the send one , not sure ). Server side code : char* UserName = new char[256]; ZeroMemory(UserName,256); recv(sConnect,UserName,256,0); // works char* Password = new char[256]; ZeroMemory(Password,256); recv(sConnect,Password,256,0); // works users[ ++usercount ] = new Client(UserName,Password,sConnect); if( users[usercount] ->GetLogInSuccesful() ) send(sConnect,"0x0001",6,0); // debugging shows it gets here and sends the data. Client side code : send(server->getsConnect(),User,256,0); // works send(server->getsConnect(),Pass,256,0); // works char* Response = new char[6]; ZeroMemory(Response,6); recv(server->getsConnect(),Response,6,0); // gets stuck here. Any ideea why does it get stuck on that recv ? I also tried by making response [256] or such.

    Read the article

  • Socket in C: recv overwrite a char[]

    - by Possa
    Hi all, I'm trying to make a little client-server script like many others that I've done in the past. But in this one I have a problem. It is better if I post the code and the output it give me. Code: #include <mysql.h> //not important now #include <stdlib.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <netdb.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <signal.h> #include <string.h> //constant definition #define SERVER_PORT 2121 #define LINESIZE 21 //global var definition char victim_ip[LINESIZE], file_write[LINESIZE], hacker_ip[LINESIZE]; //function void leggi (int); //not use now for debugging purpose //void scriviDB (); //not important now main () { int sock, client_len, fd; struct sockaddr_in server, client; // transport end point if((sock = socket(AF_INET, SOCK_STREAM, 0)) == -1) { perror("system call socket fail"); exit(1); } server.sin_family = AF_INET; server.sin_addr.s_addr = inet_addr("10.10.10.1"); server.sin_port = htons(SERVER_PORT); // binding address at transport end point if (bind(sock, (struct sockaddr *)&server, sizeof server) == -1) { perror("system call bind fail"); exit(1); } //fprintf(stderr, "Server open: listening.\n"); listen(sock, 5); /* managae client connection */ while (1) { client_len = sizeof(client); if ((fd = accept(sock, (struct sockaddr *)&client, &client_len)) < 0) { perror("accepting connection"); exit(1); } strcpy(hacker_ip, inet_ntoa(client.sin_addr)); printf("1 %s\n", hacker_ip); //debugging purpose //leggi(fd); ////////////////////////// //receive client recv(fd, victim_ip, LINESIZE, 0); victim_ip[sizeof(victim_ip)] = '\0'; printf("2 %s\n", hacker_ip); //debugging purpose recv(fd, file_write, LINESIZE, 0); file_write[sizeof(file_write)] = '\0'; printf("3 %s\n", hacker_ip); //debugging purpose printf("%s@%s for %s\n", file_write, victim_ip, hacker_ip); //send to client send(fd, hacker_ip, 40, 0); //now is hacker_ip for debug ///////////////////////// close(fd); }//end while exit(0); } //end main Client send string: ./send -i 10.10.10.4 -f filename.ext so the script send -i (IP) and -f (FILE) at the server. Here's my output server side: 1 10.10.10.6 2 10.10.10.6 3 [email protected] for As you can see the printf(3) and the printf(ip,file,ip) fail. I don't know how and where but someone overwrite my hacker_ip string. Thanks for your help! :)

    Read the article

  • C socket programming: calling recv() changes my socket file descriptor?

    - by fourier
    Hey all, I have this strange problem with recv(). I'm programming client/server where client send() a message (a structure to be exact) and server recv() it. I am also working with multiple sockets and select(). while(1) { readset = info->read_set; info->copy_set = info->read_set; timeout.tv_sec = 1; timeout.tv_usec = 0; // 0.5 seconds ready = select(info->max_fd+1, &readset, NULL, NULL, &timeout); if (ready == -1) { printf("S: ERROR: select(): %s\nEXITING...", strerror(errno)); exit(1); } else if (ready == 0) { continue; } else { printf("S: oh finally you have contacted me!\n"); for(i = 0; i < (info->max_fd+1); i++) { if(FD_ISSET(i, &readset)) //this is where problem begins { printf("S: %i is set\n", i); printf("S: we talking about socket %i son\n", i); // i = 4 num_bytes = recv(i, &msg, MAX_MSG_BYTE, 0); printf("S: number of bytes recieved in socket %i is %i\n", i, num_bytes); // prints out i = 0 what?? if (num_bytes == 0) { printf("S: socket has been closed\n"); break; } else if (num_bytes == -1) { printf("S: ERROR recv: %d %s \n", i, strerror(errno)); continue; } else { handle_request(arg, &msg); printf("S: msg says %s\n", msg->_payload); } } // if (FD_ISSET(i, &readset) else printf("S: %i is not set\n", i); } // for (i = 0; i < maxfd+1; i++) to check sockets for msg } // if (ready == -1) info->read_set = info->copy_set; printf("S: copied\n"); } the problem I have is that in read_set, 0~3 aren't set and 4 is. That is fine. But when i call recv(), i suddently becomes 0. Why is that? It doesn't make sense to me why recv() would take an socket file descriptor number and modify to another number. Is that normal? Am I missing something? S: 0 is not set S: 1 is not set S: 2 is not set S: 3 is not set S: 4 is set S: we talking about socket 4 son S: i is strangely or unstrangely 0 S: number of bytes recieved in socket 0 is 40 That's what it prints out.

    Read the article

  • How do I abort a socket.recv() from another thread in python?

    - by Samuel Skånberg
    I have a main thread that waits for connection. It spawns client threads that will echo the response from the client (telnet in this case). But say that I want to close down all sockets and all threads after some time, like after 1 connection. How would I do? If I do clientSocket.close() from the main thread, it won't stop doing the recv. It will only stop if I first send something through telnet, then it will fail doing further sends and recvs. My code look like this: # Echo server program import socket from threading import Thread import time class ClientThread(Thread): def __init__(self, clientSocket): Thread.__init__(self) self.clientSocket = clientSocket def run(self): while 1: try: # It will hang here, even if I do close on the socket data = self.clientSocket.recv(1024) print "Got data: ", data self.clientSocket.send(data) except: break self.clientSocket.close() HOST = '' PORT = 6000 serverSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) serverSocket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) serverSocket.bind((HOST, PORT)) serverSocket.listen(1) clientSocket, addr = serverSocket.accept() print 'Got a new connection from: ', addr clientThread = ClientThread(clientSocket) clientThread.start() time.sleep(1) # This won't make the recv in the clientThread to stop immediately, # nor will it generate an exception clientSocket.close()

    Read the article

  • Python : How to close a UDP socket while is waiting for data in recv ?

    - by alexroat
    Hello, let's consider this code in python: import socket import threading import sys import select class UDPServer: def __init__(self): self.s=None self.t=None def start(self,port=8888): if not self.s: self.s=socket.socket(socket.AF_INET, socket.SOCK_DGRAM) self.s.bind(("",port)) self.t=threading.Thread(target=self.run) self.t.start() def stop(self): if self.s: self.s.close() self.t.join() self.t=None def run(self): while True: try: #receive data data,addr=self.s.recvfrom(1024) self.onPacket(addr,data) except: break self.s=None def onPacket(self,addr,data): print addr,data us=UDPServer() while True: sys.stdout.write("UDP server> ") cmd=sys.stdin.readline() if cmd=="start\n": print "starting server..." us.start(8888) print "done" elif cmd=="stop\n": print "stopping server..." us.stop() print "done" elif cmd=="quit\n": print "Quitting ..." us.stop() break; print "bye bye" It runs an interactive shell with which I can start and stop an UDP server. The server is implemented through a class which launches a thread in which there's a infinite loop of recv/*onPacket* callback inside a try/except block which should detect the error and the exits from the loop. What I expect is that when I type "stop" on the shell the socket is closed and an exception is raised by the recvfrom function because of the invalidation of the file descriptor. Instead, it seems that recvfrom still to block the thread waiting for data even after the close call. Why this strange behavior ? I've always used this patter to implements an UDP server in C++ and JAVA and it always worked. I've tried also with a "select" passing a list with the socket to the xread argument, in order to get an event of file descriptor disruption from select instead that from recvfrom, but select seems to be "insensible" to the close too. I need to have a unique code which maintain the same behavior on Linux and Windows with python 2.5 - 2.6. Thanks.

    Read the article

  • High data on recv-q buffer and thread lock on java.io.BufferedInputStream in linux

    - by Sagar Patel
    We have a java application running on linux (ubuntu server). We have been facing high recv-q problem since quite some time. Application gets hang and does not read data from socket every few hours. In thread dump, we have found below stack trace. "Receiver-146" daemon prio=10 tid=0x00007fb3fc010000 nid=0x7642 runnable [0x00007fb5906c5000] java.lang.Thread.State: RUNNABLE at java.net.SocketInputStream. socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:150) at java.net.SocketInputStream.read(SocketInputStream.java:121) at java.io.BufferedInputStream.fill(BufferedInputStream.java:235) at java.io.BufferedInputStream.read1(BufferedInputStream.java:275) at java.io.BufferedInputStream.read(BufferedInputStream.java:334) - locked <0x00000007688f1ff0> (a java.io.BufferedInputStream) at org.smpp.TCPIPConnection.receive(TCPIPConnection.java:413) at org.smpp.ReceiverBase.receivePDUFromConnection(ReceiverBase.java:197) at org.smpp.Receiver.receiveAsync(Receiver.java:351) at org.smpp.ReceiverBase.process(ReceiverBase.java:96) at org.smpp.util.ProcessingThread.run(ProcessingThread.java:199) at java.lang.Thread.run(Thread.java:722) We are not able to trace the exact reason behind this? Kindly help. We are using 16 core machine and load on the system is around 30-40 at the time of issue. We use command ss dst <ip> to find out recv-q. Recently we have been facing issues with recv-q size getting hung, were in receive buffer gets stuck at some point of time. But recvQ size is not decreasing and as a result we are losing a lot of hits from the other side, our application is not accepting any data.

    Read the article

  • recv with MSG_NONBLOCK and MSG_WAITALL

    - by osgx
    Hello I want to use recv syscall with nonblocking flags MSG_NONBLOCK. But with this flag syscall can return before full request is satisfied. So, can I add MSG_WAITALL flag? Will it be nonblocking? or how should I rewrite blocking recv into the loop with nonblocking recv

    Read the article

  • sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 command returns error

    - by nyamka
    I'm trying to install Mongodb on Ubuntu 12 but when I run this command: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 This returned the error below: keyserver.ubuntu.com host not found gpgkeys: HTTP fetch error 7: couldn't connect: no such file or directory gpg:no valid openPGP data found gpg: Total number processes :0 I turned off Firewall on Iptables, but it don't work. Is there any idea?

    Read the article

  • EOF error using recv in python

    - by tipu
    I am doing this in my code, HOST = '192.168.1.3' PORT = 50007 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((HOST, PORT)) query_details = {"page" : page, "query" : query, "type" : type} s.send(str(query_details)) #data = eval(pickle.loads(s.recv(4096))) data = s.recv(16384) But I am continually getting EOF at the last line. The code I am sending with, self.request.send(pickle.dumps(results))

    Read the article

  • Socket send recv functions

    - by viswanathan
    I have created a socket using the following lines of code. Now i change the value of the socket i get like this m_Socket++; Even now the send recv socket functions succeeds without throwing SOCKET_ERROR. I expect that it must throw error. Am i doing something wrong. struct sockaddr_in ServerSock; // Socket address structure to bind the Port Number to listen to char *localIP ; SOCKET SocServer; //To Set up the sockaddr structure ServerSock.sin_family = AF_INET; ServerSock.sin_addr.s_addr = INADDR_ANY; ServerSock.sin_port = htons(pLantronics->m_wRIPortNo); // To Create a socket for listening on wPortNumber if(( SocServer = socket( AF_INET, SOCK_STREAM, 0 )) == INVALID_SOCKET ) { return FALSE; } //To bind the socket with wPortNumber if(bind(SocServer,(sockaddr*)&ServerSock,sizeof(ServerSock))!=0) { return FALSE; } // To Listen for the connection on wPortNumber if(listen(SocServer,SOMAXCONN)!=0) { return FALSE; } // Structure to get the IP Address of the connecting Entity sockaddr_in insock; int insocklen=sizeof(insock); //To accept the Incoming connection on the wPortNumber pLantronics->m_Socket=accept(SocServer,(struct sockaddr*)&insock,&insocklen); if(pLantronics->m_Socket == INVALID_SOCKET) { shutdown(SocServer, 2 ); closesocket(SocServer ); return FALSE; } // To make socket non-blocking DWORD dwNonBlocking = 1; if(ioctlsocket( pLantronics->m_Socket, FIONBIO, &dwNonBlocking )) { shutdown(pLantronics->m_Socket, 2); closesocket(pLantronics->m_Socket); return FALSE; } pLantronics->m_sModemName = inet_ntoa(insock.sin_addr); Now i do m_Socket++;//change to some other number ideally expecting send recv to fail. Even now the send recv socket functions succeeds without throwing SOCKET_ERROR. I expect that it must throw error. Am i doing something wrong.

    Read the article

  • Nginx + php-fpm - recv() error

    - by Ilya Biryukov
    I get the follow error in the nginx log [error] 17734#0: *6643 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: [cut], server: [cut], request: "GET /venues HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "[cut]" I have a dedicated box with 8 gb ram, quad core chip. Good server. Nginx, php-fpm & mysql all latest versions running under ubuntu 10.04 I only get this when I stress test the server with siege. If I increase the number of concurrent connections to 100, I can get up to 20% of all requests to fail. Furthermore, I don't get this on pages that have no mysql queries. And only a few failures on pages with moderate number of queries. Bit, I'm not sure if that's got to do anything with it. I have a feeling this is something to do with php. But I can't figure it out. Any suggestions of where to even start looking? Update: and the php error log is silent. No record of anything going wrong

    Read the article

  • Socket.recv works but not gets or read?

    - by Earlz
    Hello I've been messing around with Sockets in Ruby some and came across some example code that I tried modifying and broke. I want to know why it's broken. Server: require "socket" dts = TCPServer.new('127.0.0.1', 20000) loop do Thread.start(dts.accept) do |s| print(s, " is accepted\n") s.write(Time.now) print(s, " is gone\n") s.close end end Client that works: require 'socket' streamSock = TCPSocket.new( "127.0.0.1", 20000 ) streamSock.print( "Hello\n" ) str = streamSock.recv( 100 ) print str streamSock.close Client that is broken require 'socket' streamSock = TCPSocket.new( "127.0.0.1", 20000 ) streamSock.print( "Hello\n" ) str=streamSock.read #this line modified print str streamSock.close I know that the streamSock.print is unnecessary (as well as the naming scheme being non-ruby) but I don't understand why read doesn't work while recv does, Why is this?

    Read the article

  • C socket programming: recv / select not seeing sent messages

    - by Fantastic Fourier
    Hey guys, I had some questions, about socket programming for client-server using TCP/IP. I am using select() to recv(), which works fine when client send() messages to server, but not the other way around. The send() returns positive (and reasonable) numbers of bytes sent by server but I know that the nubmer of bytes "sent" really means "sent out of the socket", not "sent and was received by the client." The select() function seems to work fine. So given that, my guess is that it's the send() function that is giving me the problem. Probably the address of client in send() is not correct. But when I compared address.sin_addr.s_addrmember (it's an unsigned long int) of struct sockaddr_in from recv() and send() of server, they are identical. So I am kind of lost as to what could be wrong?

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >