websocket 与 用户对接并发

实现 用户登录 对接 ,能处理多人数 聊天并发问题


Csdn user default icon

<div class="post-text" itemprop="text"> <p>I have studied the Godoc of the gorilla/websocket package.</p> <p>In the Godoc it is clearly stated that</p> <blockquote> <p>Concurrency Connections support one concurrent reader and one concurrent writer.</p> <p>Applications are responsible for ensuring that no more than one goroutine calls the write methods (NextWriter, SetWriteDeadline, WriteMessage, WriteJSON, EnableWriteCompression, SetCompressionLevel) concurrently and that no more than one goroutine calls the read methods (NextReader, SetReadDeadline, ReadMessage, ReadJSON, SetPongHandler, SetPingHandler) concurrently.</p> <p>The Close and WriteControl methods can be called concurrently with all other methods.</p> </blockquote> <p>However, in one of the example provided by the package</p> <pre><code>func (c *Conn) readPump() { defer func() { hub.unregister &lt;- c c.ws.Close() }() c.ws.SetReadLimit(maxMessageSize) c.ws.SetReadDeadline(time.Now().Add(pongWait)) c.ws.SetPongHandler(func(string) error { c.ws.SetReadDeadline(time.Now().Add(pongWait)); return nil }) for { _, message, err := c.ws.ReadMessage() if err != nil { if websocket.IsUnexpectedCloseError(err, websocket.CloseGoingAway) { log.Printf("error: %v", err) } break } message = bytes.TrimSpace(bytes.Replace(message, newline, space, -1)) hub.broadcast &lt;- message } } </code></pre> <p>Source: <a href="https://github.com/gorilla/websocket/blob/a68708917c6a4f06314ab4e52493cc61359c9d42/examples/chat/conn.go#L50" rel="nofollow noreferrer">https://github.com/gorilla/websocket/blob/a68708917c6a4f06314ab4e52493cc61359c9d42/examples/chat/conn.go#L50</a></p> <p>This line</p> <pre><code>c.ws.SetPongHandler(func(string) error { c.ws.SetReadDeadline(time.Now().Add(pongWait)); return nil }) </code></pre> <p>and this line</p> <pre><code>_, message, err := c.ws.ReadMessage() </code></pre> <p>seems to be not synchronized because the first line is a callback function so it should be invoked in a Goroutine created in the package and the second line is executing in the Goroutine that invoke <code>serveWs</code></p> <p>More importantly, how should I ensure that no more than one goroutine calls the <code>SetReadDeadline</code>, <code>ReadMessage</code>, <code>SetPongHandler</code>, <code>SetPingHandler</code> concurrently?</p> <p>I tries to use a Mutex lock and lock it whenever I call the above functions, and unlock it afterwards, but quickly I realize a problem. It is usual (also in the example) that <code>ReadMessage</code> is being called in a for-loop. But if the Mutext is locked before the ReadMessage, then no other Read-functions can acquire the lock and execute until next message is received</p> <p>Is there any better way in handling this concurrency issue? Thanks in advance.</p> </div>


<div class="post-text" itemprop="text"> <p>I am using <code>github.com/gorilla/websocket</code> for websockets. I have this code</p> <pre><code>type CONN struct { Conn *websocket.Conn Username string hand []string mu *sync.Mutex } func (c *CONN) Send(messageType int, message []byte) error { c.mu.Lock() defer c.mu.Unlock() return c.Conn.WriteMessage(messageType, message) } //later... connection.Send(messageType, []byte("play")) connection.Send(messageType, []byte("[\"a\", \"b\", \"c\"]")) </code></pre> <p>These last two lines are giving me the error. Please let me know if you need any more code to figure it out. Here's the error:</p> <pre><code>2019/06/15 15:19:03 http: panic serving [::1]:56788: concurrent write to websocket connection goroutine 10 [running]: net/http.(*conn).serve.func1(0xc000164140) /usr/lib64/go/1.11/src/net/http/server.go:1746 +0xd0 panic(0x6654e0, 0x7125a0) /usr/lib64/go/1.11/src/runtime/panic.go:513 +0x1b9 github.com/gorilla/websocket.(*messageWriter).flushFrame(0xc000043a18, 0xc000016501, 0xc00001656c, 0x0, 0x4, 0x713e00, 0xc0001141e0) /home/victor/programs/goprograms/src/github.com/gorilla/websocket/conn.go:597 +0x631 github.com/gorilla/websocket.(*Conn).WriteMessage(0xc0001a4160, 0x1, 0xc000016568, 0x4, 0x8, 0x4, 0xc000016568) /home/victor/programs/goprograms/src/github.com/gorilla/websocket/conn.go:753 +0x24b main.(*CONN).Send(0xc00015c280, 0x1, 0xc000016568, 0x4, 0x8, 0x0, 0x0) /home/victor/programs/goprograms/src/v/asdf/network/main.go:32 +0x9e main.wsHandler(0x716960, 0xc00011e380, 0xc000116400) /home/victor/programs/goprograms/src/v/asdf/network/main.go:68 +0x501 net/http.HandlerFunc.ServeHTTP(0x6e1ab0, 0x716960, 0xc00011e380, 0xc000116400) /usr/lib64/go/1.11/src/net/http/server.go:1964 +0x44 net/http.(*ServeMux).ServeHTTP(0x8dadc0, 0x716960, 0xc00011e380, 0xc000116400) /usr/lib64/go/1.11/src/net/http/server.go:2361 +0x127 net/http.serverHandler.ServeHTTP(0xc00008d040, 0x716960, 0xc00011e380, 0xc000116400) /usr/lib64/go/1.11/src/net/http/server.go:2741 +0xab net/http.(*conn).serve(0xc000164140, 0x716b60, 0xc00005a800) /usr/lib64/go/1.11/src/net/http/server.go:1847 +0x646 created by net/http.(*Server).Serve /usr/lib64/go/1.11/src/net/http/server.go:2851 +0x2f5 </code></pre> <p><a href="https://gist.github.com/vityavv/a97ac9fe9192cb7107e6c7979f90cafc" rel="nofollow noreferrer">Here is the full code I am using</a> - line 75 is where the connection is set. I don't see how there could be multiple connections under one item in the map.</p> </div>


<div class="post-text" itemprop="text"> <p>Let's say i want to identify each user that initiate a connection to a php websocket server (Ratchet).</p> <p>Each user have an unique token in my database (not enough secure i know, but let's keep this example simple).</p> <p>I have to send this token when opening the connection to the WS server and check in my database if it match any user and if yes allowing to continue and storing the connection id of the WS to be able to link the user to the ws connection.</p> <p>Then connected user id 1 want's to send a message to connected user id 2</p> <p><strong>Do i have to search in the database the connection id of user 2 to be able to send the message ? or does there is an alternative, like a global array which stay in the memory or something and where the WS server can access it all time ? this would be less heavy than requesting the database if i just could store a link between "user Id" and "ws connection Id" directly in the memory or something</strong></p> </div>




看了网上很多springwebsocket的帖子,关于用户的session都是存在map或List里 比如 private static Map<String, WebSocketSession> users = new ConcurrentHashMap<String,WebSocketSession>(); 但是在做集群的时候,用户肯定不会再同一台服务器中存储。 我试着用redis存储WebSocketSession,但是WebSocketSession不能序列华,大家有什么好的思路吗?

如何使用Golang Gorilla / mux托管并发Websocket连接?

<div class="post-text" itemprop="text"> <p>thanks in advance for any help or advice! </p> <p>I am building a chess application, the frontend is in Reactjs and backend is a server written in Golang using Gorilla mux library. The backend is a chess engine for the human user to play against. The react frontend creates a WebSocket connection with the server in the top-level constructor. </p> <p>The app works well for a single connection. However, upon opening a second browser tab, the first browser tab's Websocket connection is lost. </p> <p>The server reports the error, </p> <pre><code>read error: websocket: close 1001 (going away) </code></pre> <p>and then,</p> <pre><code>read error: read tcp\u003e127.0.0.1:64146: use of closed network connection </code></pre> <p>I've looked at the Gorrilla/mux documentation for websockets and am reading/writing all from the same function in order to avoid concurrent reads or writes on the same connection. </p> <p>React frontend constructor is here: </p> <pre><code>class Game extends React.Component { constructor(props) { super(props); this.state = { history: [{ position: this.props.chess.fen(), move: "", }], ply: 0, selectedSq: null, engineName: "", engineAuthor: "", uciOK: false, isReady: false, engineThinking: false, playersTurn: true, playerColor: WHITE, }; this.ws = websocketConnect("ws://localhost:8081/uci"); this.ws.onmessage = (event) =&gt; { const msg = event.data this.processEngineMessage(msg) } } </code></pre> <p>It is referencing websocket.js which is here: </p> <pre><code>export function websocketConnect(url) { const ws = new WebSocket(url); ws.addEventListener('open', (event) =&gt; { ws.send('uci'); }); return ws; } </code></pre> <p>Goland Websocket package is here</p> <pre><code>package websocket import ( "net/http" "github.com/namsral/flag" log "github.com/sirupsen/logrus" "github.com/gorilla/websocket" ) type WebsocketServer struct { upgrader websocket.Upgrader addr *string conn *websocket.Conn } func NewWebsocketServer() *WebsocketServer { w := new(WebsocketServer) w.addr = flag.String("addr", "localhost:8081", "http service address") flag.Parse() w.upgrader = websocket.Upgrader{} // use default options http.HandleFunc("/uci", w.uciHandler) return w } func (w *WebsocketServer) uciHandler(rw http.ResponseWriter, r *http.Request) { var err error log.Error("upgrading to websocket connection") w.upgrader.CheckOrigin = func(r *http.Request) bool { return true } w.conn, err = w.upgrader.Upgrade(rw, r, nil) if err != nil { log.Print("upgrade:", err) return } go w.UCI(rw, r) } func (w *WebsocketServer) Start() { log.Info("starting websocket server") http.ListenAndServe(*w.addr, nil) } func (w *WebsocketServer) CloseConnection() { w.conn.Close() } func (w *WebsocketServer) StartReader(channel chan string) { for { _, message, err := w.conn.ReadMessage() if err != nil { log.Println("read error:", err) break } log.Printf("recv: %s", message) channel &lt;- string(message) } } func (w *WebsocketServer) Write(msg string) { err := w.conn.WriteMessage(websocket.TextMessage, []byte(msg)) if err != nil { log.Println("write:", err) } } </code></pre> <p>Full code here: server: <a href="https://github.com/tonyOreglia/glee" rel="nofollow noreferrer">https://github.com/tonyOreglia/glee</a> frontend: <a href="https://github.com/tonyOreglia/chess-board-react" rel="nofollow noreferrer">https://github.com/tonyOreglia/chess-board-react</a></p> <p>I am hoping to be able to support multiple concurrent users using the website. It is currently hosted on DigitalOcean.</p> </div>


我是用dva搭建的项目,项目中在model模块开启了websocket监听,接收到对应的消息类型,下发到对应的异步函数中 ![图片说明](https://img-ask.csdn.net/upload/201903/15/1552614682_13306.png) 在acceptMessage中更新我的state ![图片说明](https://img-ask.csdn.net/upload/201903/15/1552614746_639769.png) 但是websocket推送过来的消息并发较大,这样就导致在accpetMessage中获取的messageList的长度都是相同,最后更新的时候messageList就会丢掉很多消息, 在下初学react,希望大神指点迷津!

Gorilla WebSocket与golang.org/x/net/websocket的比较

<div class="post-text" itemprop="text"> <p>According <a href="https://github.com/gorilla/websocket#gorilla-websocket-compared-with-other-packages" rel="nofollow">Gorilla Websockets Project</a> it is not possible to send pings and pongs using <strong>golang.org/x/net/websocket</strong>. At the same time, the following is on the project page of <a href="http://godoc.org/golang.org/x/net/websocket" rel="nofollow">golang.org/x/net/websocket</a>:</p> <blockquote> <p>Package websocket implements a client and server for the WebSocket protocol as specified in RFC 6455.</p> </blockquote> <p>I am a little confused. <strong>golang.org/x/net/websocket</strong> implements RFC 6455 but can not send control frames (cancel, ping, pong) although this is specified in <a href="http://tools.ietf.org/html/rfc6455#section-5.5" rel="nofollow">RFC 6455 - Section Control Frames</a></p> <p>So what will happen if I use <strong>golang.org/x/net/websocket</strong> package. Will the connection abort after a timeout? In other words, how is it ensured here that the connection does not break off.</p> </div>

websocket 聊天室,怎么实时显示在线的用户



websocket一直连接着的话, 是不是session一直都不会超时呢? 现在web端需要使用websocket不断推送通知消息, 如果session永远不会超时, 那岂不是爆炸?


客户端使用websocket,服务器使用Java Socket。客户端经过new webSocket(utl)之后,服务器端可以收到请求头,但是客户端的webSocket.readyState一直是0,没有连接成功,这个是因为什么呢?是不是因为服务器端不可以用Java Socket

Golang WebSocket客户端

<div class="post-text" itemprop="text"> <p>I want to make client websocket connections to exertnal server each connection = goroutine and reader. I was looking informations on the internet but I found how to create server websocket tutorials. Can anyone be so kind and make a trivial example and walk me through. I am using standart golang libary <a href="https://golang.org/x/net/websocket" rel="nofollow">https://golang.org/x/net/websocket</a>.</p> <p>I created some code but when I closed one connection program exited with EOF information. I won't post the code because it's probably bad duo to the fact it was my first try.</p> <p>I know how to read/send message from websocket but I don't know how to create multiple connections.</p> <p>Any informations, examples would be appreciate, thanks for reading</p> </div>


<div class="post-text" itemprop="text"> <p>I am very new to Go and have found myself working with sockets as my first project. This is a redundant question, but I have failed to understand how to send a websocket update to a specific client in Go (using Gorilla).</p> <p>The broad problem that I am trying to solve is - Building a typeahead using websockets and a search engine like ES/Lucene. I have maintained a bunch of indexes on my search engine and have a Go wrapper around it. When I started working on using websockets in Go, I have been finding almost all the examples showing broadcasting mechanism. When I tried to dig into this and tried to modify the example given in Gorilla's github <a href="https://github.com/gorilla/websocket/tree/master/examples/chat" rel="nofollow noreferrer">repo</a> based on the examples given in <a href="https://github.com/gorilla/websocket/issues/46" rel="nofollow noreferrer">this</a> thread and in this <a href="https://stackoverflow.com/questions/31598147/how-to-send-to-only-one-client-and-not-all-clients-using-go-and-gorilla-websocke">answer</a>, I don't seem to understand <code>connections</code> and how does that fit in <code>client.go</code></p> <p>Ideally, the way I would like to see this working is -</p> <ul> <li>A socket connection between the client and server is established</li> <li>Upon the client sending inputs via the socket, the server fetches it and throws into into a channel (Go channel)</li> <li>The indexing wrapper checks for this channel, and once there is something to fetch, the index is retrieved and written back to the socket</li> </ul> <p>How can the server uniquely identify the <code>Client</code>?</p> <p>I have used the examples given on Gorilla's Github <a href="https://github.com/gorilla/websocket/tree/master/examples/chat" rel="nofollow noreferrer">repo</a></p> <p>From my codebase <code>hub.go</code> has the following </p> <pre><code>type Hub struct { // Registered clients. clients map[*Client]bool // Inbound messages from the clients. broadcast chan []byte // Register requests from the clients. register chan *Client // Unregister requests from clients. unregister chan *Client connections map[string]*connection } func newHub() *Hub { return &amp;Hub{ broadcast: make(chan []byte), register: make(chan *Client), unregister: make(chan *Client), clients: make(map[*Client]bool), connection: make(map[*Client]bool), // is this alright? } } func (h *Hub) run() { for { select { case client := &lt;-h.register: h.clients[client] = true case client := &lt;-h.unregister: if _, ok := h.clients[client]; ok { delete(h.clients, client) close(client.send) } case message := &lt;-h.broadcast: for client := range h.connections { select { case client.send &lt;- message: default: close(client.send) delete(h.connections, client) } } } } } </code></pre> <p>and I am unsure with what I should be adding to <code>client.go</code></p> <pre><code>type Client struct { // unique ID for each client // id string // Hub object hub *Hub // The websocket connection. conn *websocket.Conn // Buffered channel of outbound messages. send chan []byte // connection --&gt; (what should the connection property be?) connection string } </code></pre> <p>Please note - I will be adding an <code>Id</code> field within the <code>Client</code> struct. How can I proceed from here?</p> </div>





python websocket 实时通讯怎么保证用户a 建立连接后, 发送数据到服务端, 服务端返回信息给a ,而不是给b或c, 也就是一对一这种?

python websocket 实时通讯怎么保证用户a 建立连接后, 发送数据到服务端, 服务端返回信息给a ,而不是给b或c, 也就是一对一这种?

Gorilla Websocket手动关闭客户端连接

<div class="post-text" itemprop="text"> <p>I try to close connect manual(use <a href="https://dwst.github.io/" rel="nofollow noreferrer">Dark WebSocket Terminal</a>),but the client tell me 1005 (No Status Rcvd)<br> Server:</p> <pre><code>ReadLoop: for { mt, message, err := c.ReadMessage() if err != nil { log.Println("read:", err) log.Println("messageType:", mt) if websocket.IsUnexpectedCloseError(err, websocket.CloseGoingAway, websocket.CloseAbnormalClosure) { log.Printf("error: %v", err) } c.WriteMessage(websocket.CloseMessage, websocket.FormatCloseMessage(websocket.CloseNormalClosure, "")) break ReadLoop } log.Printf("recv: %s", message) //do sth in here err = c.WriteMessage(mt, message) if err != nil { //WriteMessage wrong log.Println("write:", err) break ReadLoop } } </code></pre> <p>It is not work and show the expected outputting the following:</p> <pre><code>read: websocket: close 1005 (no status) messageType: -1 error: websocket: close 1005 (no status) </code></pre> <p>How should i go about this?</p> </div>


<div class="post-text" itemprop="text"> <p>How is it possible to close a websocket connection and pass it a message / code?</p> <p>The docs only define <code>func (ws *Conn) Close() error</code> without any arguments</p> <p>I would like to receive the event from JavaScript like this:</p> <pre><code>websocket.onclose = function(event) { console.log(event); }; </code></pre> <p>I am using <a href="https://godoc.org/golang.org/x/net/websocket" rel="nofollow">golang.org/x/net/websocket</a></p> </div>


参考了http://blog.chenzuhuang.com/archive/28.html 的代码,成功利用Tomcat8搭建了JSR356标准的WebSocket服务器,HTML的客户端也成功实现了,但是我想写一个Android平台下的客户端,请问 ``` //判断当前浏览器是否支持WebSocket if('WebSocket' in window){ websocket = new WebSocket("ws://localhost:8080/MyWebSocket/websocket"); } else{ alert('Not support websocket') } //连接发生错误的回调方法 websocket.onerror = function(){ setMessageInnerHTML("error"); }; //连接成功建立的回调方法 websocket.onopen = function(event){ setMessageInnerHTML("open"); } //接收到消息的回调方法 websocket.onmessage = function(){ setMessageInnerHTML(event.data); } //连接关闭的回调方法 websocket.onclose = function(){ setMessageInnerHTML("close"); } //监听窗口关闭事件,当窗口关闭时,主动去关闭websocket连接,防止连接还没断开就关闭窗口,server端会抛异常。 window.onbeforeunload = function(){ websocket.close(); } //将消息显示在网页上 function setMessageInnerHTML(innerHTML){ document.getElementById('message').innerHTML += innerHTML + '<br/>'; } //关闭连接 function closeWebSocket(){ websocket.close(); } ``` 以上的这段代码用Java怎么写?


大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...


今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...




ArrayList源码分析 前言: 写这篇博客的主要原因是,在我上一次参加千牵科技Java实习生面试时,有被面试官问到ArrayList为什么查找的速度较快,插入和删除的速度较慢?当时我回答得不好,很大的一部分原因是因为我没有阅读过ArrayList源码,虽然最后收到Offer了,但我拒绝了,打算寒假学得再深入些再广泛些,下学期开学后再去投递其他更好的公司。为了更加深入理解ArrayList,也为



String s = new String(" a ") 到底产生几个对象?

老生常谈的一个梗,到2020了还在争论,你们一天天的,哎哎哎,我不是针对你一个,我是说在座的各位都是人才! 上图红色的这3个箭头,对于通过new产生一个字符串(”宜春”)时,会先去常量池中查找是否已经有了”宜春”对象,如果没有则在常量池中创建一个此字符串对象,然后堆中再创建一个常量池中此”宜春”对象的拷贝对象。 也就是说准确答案是产生了一个或两个对象,如果常量池中原来没有 ”宜春” ,就是两个。...

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...


loonggg读完需要3分钟速读仅需 1 分钟大家好,我是你们的校长。我之前讲过,这年头,只要肯动脑,肯行动,程序员凭借自己的技术,赚钱的方式还是有很多种的。仅仅靠在公司出卖自己的劳动时...






提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...






私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...


最近接手了一个springboot项目,不是不熟悉这个框架,启动时打印的信息吸引了我。 这不是我熟悉的常用springboot的打印信息啊,我打开自己的项目: 还真是的,不用默认的感觉也挺高大上的。一时兴起,就去研究了一下源代码,还正是有些收获,稍后我会总结一下。正常情况下做为一个老程序员,是不会对这种小儿科感兴趣的,不就是一个控制台打印嘛。哈哈! 于是出于最初的好奇,研究了项目的源代码。看到


即将毕业的应届毕业生一枚,现在只拿到了两家offer,但最近听到一些消息,其中一个offer,我这个组据说客户很少,很有可能整组被裁掉。 想问大家: 如果我刚入职这个组就被裁了怎么办呢? 大家都是什么时候知道自己要被裁了的? 面试软技能指导: BQ/Project/Resume 试听内容: 除了刷题,还有哪些技能是拿到offer不可或缺的要素 如何提升面试软实力:简历, 行为面试,沟通能...

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...






当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...


HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...





你打算用Java 8一辈子都不打算升级到Java 14,真香



编程语言层出不穷,从最初的机器语言到如今2500种以上的高级语言,程序员们大呼“学到头秃”。程序员一边面临编程语言不断推陈出新,一边面临由于许多代码已存在,程序员编写新应用程序时存在重复“搬砖”的现象。 无代码/低代码编程应运而生。无代码/低代码是一种创建应用的方法,它可以让开发者使用最少的编码知识来快速开发应用程序。开发者通过图形界面中,可视化建模来组装和配置应用程序。这样一来,开发者直...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?





已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...