gary36
Full Member level 4
Hi
I am new to socket programming in linux. I was referring to this site https://www.thegeekstuff.com/2011/12/c-socket-programming/?utm_source=feedburner . I took the example of server code and executed it.
Issues
1. The example program closes the socket at end of this routine. Therefore I have to establish connections everytime from client. How should the code be modified to make server always live (without closing unless client disconnects)?
2. I also faced issues with byte transmission. Data in the range 0-9 is received in client perfectly, but the data greater than 9 is received wrongly. For example 10 is received as 1 and a 0 separately. Any ways to resolve this?
I am new to socket programming in linux. I was referring to this site https://www.thegeekstuff.com/2011/12/c-socket-programming/?utm_source=feedburner . I took the example of server code and executed it.
Issues
1. The example program closes the socket at end of this routine. Therefore I have to establish connections everytime from client. How should the code be modified to make server always live (without closing unless client disconnects)?
2. I also faced issues with byte transmission. Data in the range 0-9 is received in client perfectly, but the data greater than 9 is received wrongly. For example 10 is received as 1 and a 0 separately. Any ways to resolve this?