Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8802969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:13:05+00:00 2026-06-14T01:13:05+00:00

I use TCP function recv to receive data. Then use GetLastError() to display the

  • 0

I use TCP function “recv” to receive data. Then use GetLastError() to display the error id. It is 115. In windows error.h it is #define ERROR_PROTECTION_VIOLATION 115 /* Bad user virtual address */. Could you give me any advice?
PS: this program is running under the linux.But I think the error code in linux && windows must be the same as TCP error.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T01:13:07+00:00Added an answer on June 14, 2026 at 1:13 am

    Error codes are certainly operating system specific (so your belief that it should be the same on Windows and Linux is wrong). On Linux, you should read the errno(3) man page (which you can obtain with the man 3 errno command after installing manpages and manpages-dev packages).

    TCP don’t define error codes, AFAIK. It defines a protocol.

    A portable way to use errno is to use symbolic names like EPERM and to report the error to the user with strerror(errno) or perror. See strerror(3) and perror(3). The actual error numbers are system specific (i.e. probably not the same on Linux/x86 and on FreeBSD/ia64). the Posix standard specifies symbolic errno.h names.

    I recommend you to read good books like Advanced Linux Programming and Advanced Unix Programming.

    If you want to make portable code for Linux, Windows, MacOSX you could use frameworks like Qt

    On my Debian/Linux/AMD64 system I have

    #define EINPROGRESS 115 /* Operation now in progress */
    

    in header /usr/include/asm-generic/errno.h

    When using a syscall such as recv(2), read its man page to understand when a particular error can occur in it.

    NB: GetLastError is not a standard Linux function. It is specific to your program, or to some library linked to it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When using a boost::asio::ip::tcp:socket there are many methods one can use to write/send data.
Does Apple push use TCP or UDP to deliver messages from their servers to
I have a WCF service, that use tcp for the communication. When I try
How to use simple TCP/IP sockets connections over/with Net.TCP WCF binding? Idea is –
I have a service that use the tcp binding and this services allows to
I have a service with two contracts that I want to use with tcp
TCP and UDP(sometimes) use a simple checksum to make sure the contents are correct.
I have written a Python TCP/IP server for internal use, using win32serviceutil/py2exe to create
After studying TCP/UDP difference all week, I just can't decide which to use. I
in server -(multi)client application [TCP]. I use Socket, NetworkStream, StreamReader and StreamWriter for each

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.