Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Slight0 · Aug 23, 2015 at 12:12 AM · networkingdocumentation

What are the possible error codes for NetworkTransport.Send?

The documentation does not mention what the possible error codes are for the NetworkTransport.Send method. (As well as other methods in the class)

Defined like so

 public static bool Send(int hostId, int connectionId, int channelId, byte[] buffer, int size, out byte error);

What are the possible error codes it could output?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
5
Best Answer

Answer by Slight0 · Aug 23, 2015 at 03:06 AM

After some searching through the decompiled classes of the networking dll it seems the NetworkError enumeration directly corresponds with the returned error codes of the transport layer functions.

 //     Everything good so far.
 Ok = 0,
 //
 //     Host doesn't exist.
 WrongHost = 1,
 //
 //     Connection doesn't exist.
 WrongConnection = 2,
 //
 //     Channel doesn't exist.
 WrongChannel = 3,
 //
 //     No internal resources ro acomplish request.
 NoResources = 4,
 //
 //     Obsolete.
 BadMessage = 5,
 //
 //     Timeout happened.
 Timeout = 6,
 //
 //     Sending message too long to fit internal buffers, or user doesn't present
 //     buffer with length enouf to contain receiving message.
 MessageToLong = 7,
 //
 //     Operation is not supported.
 WrongOperation = 8,
 //
 //     Different version of protocol on ends of connection.
 VersionMismatch = 9,
 //
 //     Two ends of connection have different agreement about channels, channels
 //     qos and network parameters.
 CRCMismatch = 10,
 //
 //     The address supplied to connect to was invalid or could not be resolved.
 DNSFailure = 11,


Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image vsugrob · Sep 07, 2015 at 09:55 PM 0
Share

Thanks for digging, you saved my time!

avatar image
3

Answer by seanr · Aug 26, 2015 at 07:40 PM

http://docs.unity3d.com/ScriptReference/Networking.NetworkError.html

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by ZalmakiZ · Oct 18, 2015 at 10:53 AM

you can easy cast the error byte to the Error enum types to get a string with the error name example:

         byte lastError;
         NetworkTransport.Send(hostID, clientID, channel, data, offset, out lastError);
         if ((NetworkError)lastError != NetworkError.Ok)
         {
             Debug.Log("Message send error: " + (NetworkError)lastError);
         }
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

27 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Why is NetworkTransform marked as obsolete in 2018.3b documentation? 0 Answers

Networking Destroy Player's RPC function uhm WHAT? 1 Answer

Unity networking tutorial? 6 Answers

Question about Network.InitializeServer documentation 1 Answer

Networking useProxy Documentation Issue 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges